nginx 配置问题:worker_connections are not enough while

2019-01-03 03:12发布

nginx显示,连接数已经超过最大的限制。

站点运行几个小时之后,开始出现错误,可能是因为已有的连接没有释放,导致连接越来越多,也有可能反向代理配置的问题。搞不灵清啊,

难道真的是因为并发量太大了?

nginx反向代理服务器配置如下:

 

server {
        listen 80;
        server_name www.domain1.com;
        location /{
        proxy_pass http://localhost:4999;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        }
}

server {
        listen 80;
        server_name www.domain2.com;
        location /{
        proxy_pass http://localhost:4999;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_connect_timeout 300s;
        proxy_send_timeout 300s;
        proxy_read_timeout 300s;
        }
}

nginx配置如下:

复制代码
http {



        client_max_body_size 20m;

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


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



        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;



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


        gzip on;
        gzip_disable "msie6";
复制代码

标签: nginx
2条回答
Bombasti
2楼-- · 2019-01-03 03:35

http://localhost:4999这个对于的nginx配置是什么?

查看更多
淡お忘
3楼-- · 2019-01-03 03:47

发现这个问题的原因是因为有大量的广告请求造成的,所以和nginx配置无关。

查看更多
登录 后发表回答