Deploy node.js application to nginx

Viewed 817

I have a node.js backend application running on port 1337 and i want to deploy it to my nginx server so i can get access to my backend from another computer and other netwroks. i tried this in sites_availables and i enabled this configuration :

server {
    listen 80;

    server_name x.x.x.x(my server adrress);

    location /node {
        proxy_pass http://localhost:1337;
        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;
    }
}

then i restarted nginx

sudo service nginx restart

now i'm trying to reach x.x.x.x/node through my browser and i get 501 bad getaway.

1 Answers
Related