I'm trying to proxy another web server, on localhost:20000, from nginx. This works:
location/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:20000
}
However if I change it to:
location /myApp {
proxy_set_header..
I can only load the index.html file, all the other .css & .js 404. I can see in the browser's headers that the request for these files are going to mysite.com/jquery.js instead of mysite.com/myApp/jquery.js, so I'm guessing they aren't being proxied at that point which is why they 404. The paths to these URLs are coded relatively (). How do I get this to work. I can't change the paths in the proxied index.html files. Thanks
Edit. The backend webserver is thttpd and it is ancient. Would this effect the set_head Host? Sorry I'm not very familiar with how that layer works.