Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Configure nginx to forward port from 3000 to 80

$
0
0
http {
server {
listen 80;

location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Real-Port $server_port;
proxy_set_header X-Real-Scheme $scheme;
}
}

I have an NodeJS/Express app listening on port 3000. How do I redirect requests to `<ip-address>:3000` to `<ip-address>:80`?

The above configuration did not work. (shows `404 Not Found
nginx/1.10.3 (Ubuntu)` when I go to port 80.)

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>