How to allow nginx to reverse proxy connections

We have just been setting up nginx as a reverse proxy for a node server. Everything worked fine except the connections weren’t making it through.

You make a reverse proxy with:

location / {
    proxy_pass http://localhost:1025/;

However to make nginx (version 1.3.13 +) reverse proxy you should add change your configuration to:

location / {
    proxy_pass http://localhost:1025/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;

I learnt this from Chris Lea’s blog which is excellent. Also thank you Chris Lea for your excellent ppa’s.

One thought to “How to allow nginx to reverse proxy connections”

  1. i have a communication between two nodes and i have two locations

    node1 VM_Link:3000 & node2 VM_Link:3001

    server name :

    location/chat {listen to VM_Link:3000}
    location/back {listen to VM_Link:3001}

    the problem is when i use the first node it calls automaticly the second node and when i use the server and write it calls in the background automaticly and not


Leave a Reply