Welcome! Log In Create A New Profile

Advanced

Questions about proxy_pass and internal directives

October 18, 2012 03:28PM
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.
Subject Author Posted

Questions about proxy_pass and internal directives

mrtn October 18, 2012 03:28PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 03:54PM

Re: Questions about proxy_pass and internal directives

VBart October 18, 2012 04:24PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 04:32PM

Re: Questions about proxy_pass and internal directives

Reinis Rozitis October 18, 2012 04:56PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 06:18PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 06:48PM

Re: Questions about proxy_pass and internal directives

Reinis Rozitis October 18, 2012 07:38PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 08:08PM

Re: Questions about proxy_pass and internal directives

mrtn October 18, 2012 08:38PM

Re: Questions about proxy_pass and internal directives

VBart October 18, 2012 08:40PM

Re: Questions about proxy_pass and internal directives

Reinis Rozitis October 18, 2012 09:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready