I'm trying to use nginx to reverse proxy a specific location specification, as below:
server {
listen 80;
server_name example.com;
location /example {
proxy_pass http://localhost:8080/test;
}
}
Now, when I try and access a resource at http://example.com/example/css/styles.css
I expect it to try and access http://localhost:8080/test/css/styles.css
. But alas - I get a 404 from nginx.
When I try and access http://example.com/example
it shows me what's on http://localhost:8080/test
(so I know the base url segment is working) minus anything being imported into that page from a relative url (e.g. styles and JS files)
How do I get the reverse proxy to work with child url segments?