lots of work in a location block...
Valentin V. Bartenev
vbart at nginx.com
Wed Jun 18 07:14:26 UTC 2014
On Wednesday 18 June 2014 12:15:29 Steve Holdoway wrote:
> Hi Folks,
>
> I'm trying to integrate a python backend into a pre-existing php
> website, and am having problems doing this as I need to rewrite the url
> at the same time... eg: this is what isn't working.
>
> location = /example {
The only request, that will be handled by your location with "=" modifier
is "/example", even "/example/" isn't fit.
> rewrite /example/(.*) /$1 break;
>
> root /www/example;
>
> include proxy_params;
> proxy_pass http://python;
>
> #break;
> }
> ( stripped to bare essentials )
>
> So it's
> - strip off the /example prefix
> - set the new root ( the php site sets is outside any location block )
> - pass stripped request to the python backend.
[..]
Please note, that the "root" directive is almost meaningless in location
with "proxy_pass".
And you don't need "rewrite".
Something like that should work:
location /example/ {
include proxy_params;
proxy_pass http://python/;
}
Please also check the docs:
http://nginx.org/r/proxy_pass
http://nginx.org/r/location
wbr, Valentin V. Bartenev
More information about the nginx
mailing list