I have set up a Linode NodeBalancer to handle HTTPS traffic for my website, https://adamhelm.com, which listens on port 443. I have also set up an nginx server to route traffic to my Node.js application on port 3000 with the following nginx configuration:
listen 443;
server_name www.adamhelm.com;
location / {
proxy_pass http://localhost: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;
}
When I try to access my website at https://adamhelm.com, I get a "502 Bad Gateway" error on my web browser. The error logs from NGINX show that there is a "Permission denied" error when trying to connect to the upstream server at http://45.79.140.133:3000. The connection to the upstream server is being made from the NodeBalancer with a private connection using the IP address 192.168.255.142.
I am able to access the app through the host's IP address directly at http://45.79.140.133:3000 without any issues.
I am looking for help to correctly configure this setup.