As you can see in attached debug log there is ±20 second delay before
returning the page to Safari 5.0.2. Profiling PHP-FPM and PHP script
itself show that they render under 0.03 seconds. The connection stall is
not happening in Firefox 3.6.10
These are the response headers in Safari:
Connection:close
Content-Type:text/html
Date:Mon, 18 Oct 2010 20:56:23 GMT
Server:nginx/0.8.52
Transfer-Encoding:Identity
These are the response headers in Firefox:
Server: nginx/0.8.52
Date: Mon, 18 Oct 2010 20:56:02 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
I tested Nginx 0.8.52 with gzip off, keepalive_timeout 0,
fastcgi_max_temp_file_size 0 but no difference.
These logs doesn’t contain full logs for any single request. On
the other hand, each file contains parts of two different
connection logs. E.g. in slow2.log:
It did some further testing and Safari with User-Agent Firefox is
working correctly. Only difference I could notice is that in this case
Keep-Alive connections are enabled.
As a final solution I removed the else condition in
/src/http/ngx_http_core_module.c (line 806) that disables keep-alive
connections for Safari by default. What’s the reason this is hardcoded
by default in Nginx source?
Maybe add an option to make this user configurable in the future? Even apple.com is sending Keep-Alive headers. I suppose they know what they
are doing.
On Tue, Oct 19, 2010 at 03:40:49PM +0200, Sen Haerens wrote:
It did some further testing and Safari with User-Agent Firefox is
working correctly. Only difference I could notice is that in this case
Keep-Alive connections are enabled.
As a final solution I removed the else condition in
/src/http/ngx_http_core_module.c (line 806) that disables keep-alive
connections for Safari by default. What’s the reason this is hardcoded
by default in Nginx source?