I'm struggling to find the source of a timeout. I am running Nginx (1.2.6), Passenger 3.0.18, and Rails 3.2.11. On serving one long running request, I find the results (CSV file) truncated after being returned from the client. The Rails application however continues to serve up the data until complete, at which time it reports:
Couldn't forward the HTTP response back to the HTTP client: It seems the user clicked on the 'Stop' button in his browser.
Nginx access.log however reports a 200 for the request.
Some things I have tried:
1) I modified the Nginx read/send timeouts in the Passenger gem (ext/nginx/Configuration.c) and recompiled, with no impact.
2) I ran a test of bypassing Nginx/Passenger by going direct to my app running in Unicorn, and it serves up the result fine. I then took Passenger out of the equation by configuring Nginx to pass the requests to Unicorn, and the truncated result is back again.
3) I've played with the Nginx keepalive_timeout, proxy_read_timeout, proxy_send_timeout and send_timeout - all with no impact.
Any thoughts/advice would be much appreciated.
Joe