<div dir="ltr">Hello,<br>I&#39;m using Nginx to serve a few TurboGears projects and some Wordpress sites. Mostly is does it job more than well, but lately I&#39;m facing some problems serving not-so-big static files.<br><br>
The files come statically, and not from an upstream server.<br><br clear="all">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location ^~ /static/&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /home/user/some/static/directory;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gzip on;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gzip_comp_level 9;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expires max;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br><br>Try this link for example, which is a 1.9mb PDF file uploaded by one of my users:<br>
<a href="http://noal.org.il/static/uploads/u-20/%5B1231615256%5Dhozer.pdf">http://noal.org.il/static/uploads/u-20/%5B1231615256%5Dhozer.pdf</a><br>If I&#39;m correct, it will stop after ~1.5mb. The speed drops to 0K/s, and my logs show a timeout:<br>
2009/01/11 15:36:48 [info] 546#0: *612 client timed out (110: Connection timed out) while sending response to client, client: xxx.xxx.xxx.xxx, server: <a href="http://noal.org.il">noal.org.il</a>, request: &quot;GET /static/uploads/u-20/%5B1231615256%5Dhozer.pdf HTTP/1.0&quot;, host: &quot;<a href="http://noal.org.il">noal.org.il</a>&quot;<br>
<br>I&#39;ve tried it both from my browser and using wget - exactly same thing.<br><br>What could be causing that?<br><br>I have <br>&nbsp;&nbsp;&nbsp; tcp_nopush&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<br>&nbsp;&nbsp;&nbsp; client_max_body_size 500M;<br>&nbsp;&nbsp;&nbsp; gzip&nbsp; on;<br>on my http {} part<br>
and<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; client_header_buffer_size&nbsp;&nbsp;&nbsp; 1k;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; large_client_header_buffers&nbsp; 8 8k;<br>in the server {} one.<br><br>But commenting them didn&#39;t make a difference.<br><br>Any idea would be kindly appreciated.<br>
<br>Thanks.<br>-- <br>Yo&#39;av Moshe<br>
</div>