proxy_pass with variable removes uri

Francis Daly francis at daoine.org
Wed Mar 5 12:43:03 UTC 2014


On Wed, Mar 05, 2014 at 07:23:23AM -0500, luckyswede wrote:

Hi there,

> I've had troubles with url-decoding using this kind configuration, e.g. get
> variables with values containing spaces have been decoded before proxied
> which is resulting in an error. 

Untested, but I'd suggest to use a map (http://nginx.org/r/map) to save
the part of $request_uri that you want to use in the proxy_pass url.

It may become complicated if you want to handle people requesting things
like /ap%69/stuff, but otherwise should probably work.

(The alternative is probably to use a url encoder on the appropriate
parts of your url; I don't know of one that drop-in works.)

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list