I have the following Nginx config:
server {
listen 80;
location /test {
rewrite /test(.*) /$1 break;
proxy_pass "http://www.example.com/";
}
}
This works well for the home page and when entering 'http://localhost/test' I get the content of http://www.example.com/ and the URL remains 'http://localhost/test'.
Cool, but when I hit a link in the website, say /more_examples
I want the link to be rewritten as such: http://localhost/test/more_examples.
In practice, I get the following: http://localhost/more_examples, which obviously will not work. Is this even possible?
Any help would be greatly appreciated.