I have a requirement where i proxy pass the request coming on my server ip to nodejs server which is running on the same server at port 3000 so that when i access my application using browser i don’t have to give ip:port on the browser but instead i just hit on the browser ip and then nginx proxy pass the request to nodejs which is running on port 3000
I tried to write this code but it did not work when i try to access application by ip:3000 it works but my requirement is to access it using just ip not with port
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name 44.195.67.159;
location / {
proxy_pass http://127.0.0.1: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;
}
}
Nidhi Ghorpade is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.