nginx 1.10.0中的配置更改问题

时间:2017-06-13 07:04:58

标签: nginx configuration

我正在更改正在运行的NGINX 1.10.0的配置。在我进行更改后重新加载或重新启动服务器的那一刻,网站出现错误503,但是通过以下方式检查状态:

  1. sudo service nginx status,显示正在运行
  2. “nginx -t”命令显示语法ok
  3. 如果我回滚/撤消更改并重新加载服务器,网站仍然会在接下来的5-10分钟内停止运行,然后突然开始工作。 任何人都可以告诉这里的问题是什么????

    更改:

    server {
        listen 80 default_server;
        listen 443 ssl;
        ssl_certificate /etc/ssl/bundle.crt;
        ssl_certificate_key /etc/ssl/private.key;
        return 403;
    }
    
    server {
        listen 80;
        listen 443 ssl;
        server_name www.website.com;
        ssl_certificate /etc/ssl/bundle.crt;
        ssl_certificate_key /etc/ssl/private.key;
        return 301 $scheme://website.com$request_uri;
    }
    
    server {
    	   listen 80;
    	   server_name    website.com;
       	 return 301 https://website.com$request_uri;
    	}
    
    server {
    
      listen 443;
      server_name website.com;
      ssl on;
      qssl_certificate /etc/ssl/bundle.crt;
      ssl_certificate_key /etc/ssl/private.key;
      gzip on;
      gzip_disable "msie6";
      gzip_vary on;
      #gzip_proxied any;
      gzip_comp_level 9;
      gzip_buffers 4 32k;
      gzip_min_length 1100;
      gzip_http_version 1.0;
      gzip_types application/javascript text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript font/otf application/octet-stream application/x-font-opentype;
    expires modified +7d;
    
    location / {
    	      proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   Host      $http_host;
    	      proxy_pass http://127.0.0.1:5000;
    	}
    }
    
    nginx error logs : 2017/06/12 16:18:43 [alert] 6099#6099: *1620649 open socket #18 left in connection 12
    2017/06/12 16:18:43 [alert] 6099#6099: *1620648 open socket #17 left in connection 20
    2017/06/12 16:18:43 [alert] 6099#6099: *1620656 open socket #24 left in connection 98
    2017/06/12 16:18:43 [alert] 6099#6099: *1620655 open socket #13 left in connection 117
    2017/06/12 16:18:43 [alert] 6099#6099: *1620651 open socket #20 left in connection 150
    2017/06/12 16:18:43 [alert] 6099#6099: *1620652 open socket #21 left in connection 198
    2017/06/12 16:18:43 [alert] 6099#6099: *1620643 open socket #3 left in connection 226
    2017/06/12 16:18:43 [alert] 6099#6099: *1620657 open socket #25 left in connection 255
    2017/06/12 16:18:43 [alert] 6099#6099: *1620647 open socket #11 left in connection 282
    2017/06/12 16:18:43 [alert] 6099#6099: *1620646 open socket #15 left in connection 302
    2017/06/12 16:18:43 [alert] 6099#6099: *1620650 open socket #19 left in connection 377
    2017/06/12 16:18:43 [alert] 6099#6099: *1620653 open socket #22 left in connection 403
    2017/06/12 16:18:43 [alert] 6099#6099: *1620645 open socket #4 left in connection 733
    2017/06/12 16:18:43 [alert] 6099#6099: *1620654 open socket #23 left in connection 747
    2017/06/12 16:18:43 [alert] 6099#6099: aborting
    2017/06/12 16:26:19 [alert] 30831#30831: *10 open socket #12 left in connection 5
    2017/06/12 16:26:19 [alert] 30831#30831: *11 open socket #13 left in connection 6
    2017/06/12 16:26:19 [alert] 30831#30831: aborting
    2017/06/12 16:40:00 [alert] 30879#30879: *399 open socket #11 left in connection 3
    2017/06/12 16:40:00 [alert] 30879#30879: *416 open socket #24 left in connection 7
    2017/06/12 16:40:00 [alert] 30879#30879: *420 open socket #29 left in connection 12
    2017/06/12 16:40:00 [alert] 30879#30879: *422 open socket #31 left in connection 13
    2017/06/12 16:40:00 [alert] 30879#30879: *428 open socket #26 left in connection 18
    2017/06/12 16:40:00 [alert] 30879#30879: *406 open socket #16 left in connection 23
    2017/06/12 16:40:00 [alert] 30879#30879: *402 open socket #3 left in connection 24
    2017/06/12 16:40:00 [alert] 30879#30879: *426 open socket #23 left in connection 27
    2017/06/12 16:40:00 [alert] 30879#30879: *421 open socket #30 left in connection 36
    2017/06/12 16:40:00 [alert] 30879#30879: *424 open socket #33 left in connection 37
    2017/06/12 16:40:00 [alert] 30879#30879: *397 open socket #13 left in connection 38
    2017/06/12 16:40:00 [alert] 30879#30879: *419 open socket #28 left in connection 39
    2017/06/12 16:40:00 [alert] 30879#30879: *423 open socket #32 left in connection 41

0 个答案:

没有答案