Hello,
My question is two-part:
1. given the following setup:
root /home/www/mysite/static;
location /foo/bar/ {
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
}
Why a request for "mysite.com/foo/bar/sth.html" does not get proxied to the server at "127.0.0.1:8080"? Instead, the file "/home/www/mysite/static/foo/bar/sth.html" is served.
2. is there a way to use 'internal' directive together with 'proxy_pass' for the same location? e.g.
root /home/www/mysite/static;
location /foo/bar/ {
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
internal;
}
I've tried with the above, but it seems 'internal' directive takes precedence, and just return 404 immediately. What I want to achieve is to block direct access to files under "/home/www/mysite/static/foo/bar", and proxy all requests to an application server which will decide the access.
Any suggestion? Thank you.