Hi Antonio,<div><br></div><div>Thanks for the tip! I was serving 301s in this way before and was still experiencing the problem mentioned. I'll revert the configuration for now but any other advice would be great!</div>
<div><br></div><div>Thanks,</div><div>-Harish<br><br><div class="gmail_quote">On Sat, Jan 14, 2012 at 9:00 PM, António P. P. Almeida <span dir="ltr"><<a href="mailto:appa@perusio.net">appa@perusio.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 15 Jan 2012 02h48 WET, <a href="mailto:harish@octopart.com">harish@octopart.com</a> wrote:<br>
<br>
> [1 <multipart/alternative (7bit)>]<br>
> [1.1 <text/plain; ISO-8859-1 (7bit)>]<br>
<div class="im">> Hello,<br>
><br>
> I'm running nginx 1.0.10 with a few name based virtual hosts<br>
> configured. There are a few permanent redirects configured of the<br>
> format:<br>
><br>
> server {<br>
> listen 80;<br>
> server_name <a href="http://domain.com" target="_blank">domain.com</a>;<br>
> rewrite ^/(.*) <a href="http://www.domain.com/$1" target="_blank">http://www.domain.com/$1</a> permanent;<br>
> }<br>
<br>
</div>To do that type of thing try this and see of it helps:<br>
<div class="im"><br>
server {<br>
listen 80;<br>
server_name <a href="http://domain.com" target="_blank">domain.com</a>;<br>
</div> return 301 <a href="http://www.domain.com" target="_blank">http://www.domain.com</a>$request_uri;<br>
}<br>
<br>
There's no need for any regex capture or rewrite for that matter. The<br>
$request_uri variable has both the uri and the query string.<br>
<div class="im"><br>
> The site sees frequent POSTs to it, which in turn seemingly randomly<br>
> disconnect from the upstream server after sending the data along<br>
> (the request completes successfully upstream and then complains of a<br>
> broken pipe as nginx has disconnected). The disconnects seem highly<br>
> coupled to 301 redirects - in the debug logs it appears that every<br>
> POST is interrupted by a permanent redirect (and that the thread<br>
> serving the request stops serving requests entirely after the<br>
> redirect finishes, the last debug statement being "http log<br>
> handler"). After removing the server block the POSTs run without<br>
> any problems. I'm wondering if this is enough information to arouse<br>
> anyone's suspicions as to what the problem is? Any help would be<br>
> greatly appreciated.<br>
<br>
</div>--- appa<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>