<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">hi,</span><br><div class="gmail_quote">
<br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">currently there is no way to rewrite to a url containing a schema and</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">proy_passing the request to a upstream since such a rewrite will end</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">up in a redirect. This is a problem if nginx is running behind a proxy</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">like squid which uses abolute url's to pass the request to. however,</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">absolute uri's are valid in requests and commonly used in proxies, for</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">details see </span><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2</a><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">attached is a patch with a fix for ngx_http_rewrite_module.c which</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">introduces a new flag for the rewrite directive called "noredirect" to</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">allow redirect targets containing a schema</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">in config this will look like this:</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">location = '/foo' {</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">    rewrite  .*  "</span><a href="http://www.example.com/bar" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">http://www.example.com/bar</a><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">" noredirect;</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">    proxy_pass </span><a href="http://squid-host/" style="color:rgb(17,85,204);font-size:13px;font-family:arial,sans-serif" target="_blank">http://squid-host</a><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">;</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">}</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">regards,</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">

<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">bernd</span>
</div><br>