I am trying to run a nodejs server by using reverse proxy in Nginx from a private server. lets imagine the port of the server is 192.168.1.10. So when I type 192.168.1.10:12752 to the browser, I want to reach out to the server. However I failed in my all attempts. Here is my configuration file for the server:
server {
listen 192.168.1.10:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name "";
location / {
proxy_pass http://localhost:12752;
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;
}
}
Here, I tried lines to be different from above such as
server_name _;
# Tried completely removing server_name section
listen 80;
listen 192.168.1.10:80;
None of them seems to be working. Any help would be appreciated.