I am having trouble setting up reverse proxy with nginx forwarding requests to node sitting a the back end. My nginx conf file is :
server{
listen 80;
server_name 192.168.50.176;
location /stretch {
rewrite /stretch/(.*) /$1 break
proxy_pass http://localhost:3000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Without subdirectories it works just fine.The below config works :
server{
listen 80;
server_name 192.168.50.176;
location / {
proxy_pass http://localhost:3000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}