大网数据广告活动
服务器运维问答

' worker_connections are not enough ' even after increasing the amount to double

· 52CE 我爱测

I have a fresh installation of an rails app over app Nginx . Everything worked smooth until I decided to put SSL cert from Lets Encrypt . When I try to reach to page I get an 404 Not Found error . /error.log 2017/02/07 02:10:46 […

问题原文

原帖链接 · Godfather · CC BY-SA 3.0

I have a fresh installation of an rails app over app Nginx . Everything worked smooth until I decided to put SSL cert from Lets Encrypt . When I try to reach to page I get an 404 Not Found error .

/error.log

2017/02/07 02:10:46 [alert] 4779#0: *35005 2048 worker_connections are not enough while connecting to upstream

/etc/nginx/nginx.conf

    user  nginx;
worker_processes  2;
worker_rlimit_nofile 30000;

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

pid        /run/nginx.pid;


events {
    worker_connections  2048;
}

 server{
        listen  80;
        server_name  example.com www.example.com;
        return 301 https://$host$request_uri;
}

        server{

        listen  443 ssl;
        server_name  example.com www.example.com;
        root         /var/www/myapp/public;

        #SSL Configuration

        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

        #charset koi8-r;

        #access_log  /var/log/nginx/host.access.log  main;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                proxy_pass https://example.com;
        }

        # redirect server error pages to the static page /40x.html
        #
        error_page  404              /404.html;
        location = /40x.html {
        }

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

I've googled it and tried several attempts but nothing changed . Any help on how should I fix this ?

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

Your problem is not worker_connections. Your problem is that you have specified to proxy_pass connections back to the very same nginx server thus creating an infinite loop. When a connection comes in, nginx immediately reconnects to itself 2048 times, throws that error, and gives up.

To solve the problem, you need to proxy_pass to the correct web application, wherever it is, or remove it entirely.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。