By theotherdy
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 socket.io, 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 socket.io application fine. I’d be very grateful for any pointers on what to try next.
My /etc/nginx/sites-available/default contains:
location /node{ proxy_pass http://myprivateappserver:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade’; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Problem answered in StackOverflow: http://stackoverflow.com/questions/31456871/cannot-get-on-reverse-proxy-from-nginx-to-socket-io-on-express-js
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.