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.)
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.)