nginx:110:连接超时

时间:2016-04-14 10:14:14

标签: ruby-on-rails-4 nginx browser browser-cache

有时在浏览我的网站时,我收到连接超时错误,并且没有从服务器获得任何响应。

我在nginx错误日志文件中的错误如下

*24 client timed out (110: Connection timed out) while waiting for request, client: 182.59.129.85, server: 0.0.0.0:80

清除浏览器的缓存后,它可以正常工作。但经过一段时间的浏览后,问题再次出现。

我的nginx配置文件如下

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
error_log /var/log/nginx-error.log info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
     passenger_root /home/ubuntu/.rvm/gems/ruby-2.0.0-p598/gems/passenger-5.0.8;
     passenger_ruby /home/ubuntu/.rvm/gems/ruby-2.0.0-p598/wrappers/ruby;

    include       mime.types;
    default_type  application/octet-stream;
#    limit_req_zone $binary_remote_addr zone=one:10m rate=1r/m;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
#    limit_req_zone $binary_remote_addr zone=one:10m rate=2r/s;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;
        root /var/www/application/stag-NRB/current/public;
        rails_env staging;
#       limit_req zone=one burst=5;
        #error_log /var/log/nginx/error.log;
        passenger_enabled on;
        client_max_body_size 10000M;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        #location / {
           # root   html;
            #index  index.html index.htm;
        #}
          location / {
            #root /var/www/application/JCI-onsptNew/current/public;

            index  index.html index.htm;
 #           limit_req zone=one burst=2 nodelay;
        }

          location /download_apk {
           alias /home/ubuntu;
         }

        #root /var/www/application/JCI-onspotNew/current/public;
        #rails_env production;
        #error_log  /var/log/nginx/nginx_error.log  warn;

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        }

0 个答案:

没有答案