带有节点应用程序的NGINX 502 Bad Gateway

时间:2017-06-20 16:40:46

标签: nginx server

我遇到了my website的问题。网站出现故障" 502 Bad Gateway"来自nginx。我重新启动了服务器,没有错误。该网站运行了几个月,现在出现了这个错误。

节点应用仍在运行。没有什么改变。该网站托管在digitalocean上,一切似乎都很好。

网站位于home/naoufal/mlg不在www

之内

app.js

var port = process.env.PORT || 8888;

站点可用/默认

server {

        root /usr/share/nginx/www;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
       location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                deny all;
        }
}

nginx.config

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;

        # server_tokens off;
        server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;


        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        ##
        # nginx-passenger config
        ##
        # Uncomment it if you installed nginx-passenger
        ##

        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

       ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

出了什么问题?

感谢。

编辑:该网站现在正在运作,没有特别的原因。我认为数字海洋的问题不在于代码本身。

0 个答案:

没有答案