"Cannot GET" on reverse proxy via Nginx to

Posted July 16, 2015 32.8k views

I’ve followed this great tutorial to get Node.js working on through Nginx on a two Ubuntu 14.04 droplets via private networking - that part works fine. However, when I try and run up the fantastic chat application in, it works when I access it directly (http://mypublicappserver:3000) but, when I try and access it via my Nginx proxy (http://mywebserver/node), I get “Cannot GET /node” in the browser and in the firebug console “
"NetworkError: 404 Not Found - http://mywebserver/node”. If I curl http://myprivateappserver:3000, I get index.html from my application fine. I’d be very grateful for any pointers on what to try next.

My /etc/nginx/sites-available/default contains:

location /node{
proxypass http://myprivateappserver:3000;
httpversion 1.1;
setheader Upgrade $httpupgrade;
proxysetheader Connection ‘upgrade’;
proxysetheader Host $host;
proxycachebypass $http_upgrade;

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer