hi,<div><br></div><div>do you mean something like a new proxy directive like for example "proxy_server"?</div><div><br></div><div><div><div><div>upstream squid {</div><div>    server squid-host:3128;</div><div>}</div>
</div></div></div><div><div><div>upstream example {</div><div>    server <a href="http://www.example.com:80">www.example.com:80</a>;</div><div>}</div></div></div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);color:rgb(34,34,34)">location = '/foo' {</span></div>
<div>    proxy_server squid;<br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);color:rgb(34,34,34)"><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);color:rgb(34,34,34)">    proxy_pass </span><a href="http://www.example.com/bar" target="_blank" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">http://example/bar</a><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);color:rgb(34,34,34)">";</span><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255);color:rgb(34,34,34)">
<span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">}</span></div><div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">if "proxy_server" has been set this will be used as the actual upstream and the upstream from the proxy_pass will be used for request building.</font></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">bernd<br></font><br><div class="gmail_quote">2013/3/22 Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<div><div class="h5"><br>
On Fri, Mar 22, 2013 at 03:12:23PM +0100, Bernd Rössl wrote:<br>
<br>
> hi,<br>
><br>
> currently there is no way to rewrite to a url containing a schema and<br>
> proy_passing the request to a upstream since such a rewrite will end<br>
> up in a redirect. This is a problem if nginx is running behind a proxy<br>
> like squid which uses abolute url's to pass the request to. however,<br>
> absolute uri's are valid in requests and commonly used in proxies, for<br>
> details see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2" target="_blank">http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2</a><br>
><br>
> attached is a patch with a fix for ngx_http_rewrite_module.c which<br>
> introduces a new flag for the rewrite directive called "noredirect" to<br>
> allow redirect targets containing a schema<br>
><br>
> in config this will look like this:<br>
><br>
> location = '/foo' {<br>
>     rewrite  .*  "<a href="http://www.example.com/bar" target="_blank">http://www.example.com/bar</a>" noredirect;<br>
>     proxy_pass <a href="http://squid-host" target="_blank">http://squid-host</a>;<br>
> }<br>
<br>
</div></div>Rewrite is expected to set r->uri, which in turn expected to<br>
contain path component of a full URL.  It is bad idea to introduce<br>
flags which allow to violate this.<br>
<br>
Instead, if you need an ability to better control request line<br>
used, you may want to address this in proxy module.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/en/donation.html" target="_blank">http://nginx.org/en/donation.html</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a></font></span></blockquote></div><br></div>