Tuesday, 2 May 2017

Nginx + NodeJS redirecting to port 80

I am having issues redirecting my port 80 to 4000 where my nodejs application is running on my Digital Ocean Ubuntu Droplet. Here is my /etc/nginx/sites-available/default file:

server {
    listen 80;

    server_name my_site.com;

    location / {
        proxy_pass http://MY_IP_ADDRESS:8080;
        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;
    }
}

When ever I head over to my droplet's IP on port 4000 the application loads successfully but not when I try on port 80.



via lest96

No comments:

Post a Comment