upstream proxy support

Bernd Rössl bernd.roessl at
Fri Mar 22 14:12:23 UTC 2013


currently there is no way to rewrite to a url containing a schema and
proy_passing the request to a upstream since such a rewrite will end
up in a redirect. This is a problem if nginx is running behind a proxy
like squid which uses abolute url's to pass the request to. however,
absolute uri's are valid in requests and commonly used in proxies, for
details see

attached is a patch with a fix for ngx_http_rewrite_module.c which
introduces a new flag for the rewrite directive called "noredirect" to
allow redirect targets containing a schema

in config this will look like this:

location = '/foo' {
    rewrite  .*  "" noredirect;
    proxy_pass http://squid-host;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upstream_proxy_support.patch
Type: application/octet-stream
Size: 1157 bytes
Desc: not available
URL: <>

More information about the nginx-devel mailing list