Welcome! Log In Create A New Profile

Advanced

lots of work in a location block...

June 17, 2014 08:18PM
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 {
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.

I've tried every option I can think of, but they all seem to drop out of
the location block and process the rewritten request again, which means
that they're not using the static files in the locally defined root, and
also aren't being handed to the python backend for processing.

I've fudged it for the moment, but would really like to do it properly!

Cheers,

Steve.

Oh, proxy_params contains

proxy_next_upstream error timeout invalid_header http_500 http_502
http_503 http_504;
proxy_redirect off;
proxy_buffering off;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;




--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

lots of work in a location block...

GreenGecko June 17, 2014 08:18PM

Re: lots of work in a location block...

Valentin V. Bartenev June 18, 2014 03:16AM

Re: lots of work in a location block...

GreenGecko June 18, 2014 03:36AM

Re: lots of work in a location block...

Valentin V. Bartenev June 18, 2014 04:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 276
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready