Proxy from nginx to node - not enough worker connections

Multi tool use
Proxy from nginx to node - not enough worker connections
I want to setup nginx server listening on one port, proxying the connection to a different port to a nodejs application. The problem is that I get 500
error - worker_connections are not enough while connecting to upstream
.
500
worker_connections are not enough while connecting to upstream
Nginx config:
upstream node {
server 127.0.0.1:1235;
keepalive 8;
}
server {
listen 1234;
server_name http://123.123.123.123:1234 node;
access_log off;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://123.123.123.123:1234/;
proxy_redirect off;
}
}
What's wrong?
2 Answers
2
You may need to add:
proxy_responses 0;
to you nginx config.
You should correct your proxy_pass
since you are proxying requests back to nginx itself.
proxy_pass
According to your config it must be
proxy_pass http://node/;
proxy_pass http://node/;
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Did my answer below help you?
– rsp
Mar 13 '17 at 16:08