<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1431091691014_30265" dir="ltr">I have a python application hosted under gunicorn that is expected to have long lived requests.</div><div id="yui_3_16_0_1_1431091691014_30264" dir="ltr">It works just fine if we hit the application directly; however, we want to have nginx in front of it and are having issues with 504 errors.</div><div id="yui_3_16_0_1_1431091691014_30263" dir="ltr"><br></div><div id="yui_3_16_0_1_1431091691014_30262" dir="ltr">I found some settings on-line that seem to be what we want to change, specifically the proxy_*_timeouts and send_timeout, and applied them to an environment. However, no matter what I try it always fails at 60 seconds.</div><div id="yui_3_16_0_1_1431091691014_30261" dir="ltr">Here's the settings I am presently trying:<br></div><div id="yui_3_16_0_1_1431091691014_30260" dir="ltr"><br></div><div dir="ltr">






</div><div id="yui_3_16_0_1_1431091691014_30219" style="" class="">
<span id="yui_3_16_0_1_1431091691014_30258" class="" style="font-family:monospace"><span id="yui_3_16_0_1_1431091691014_30259" class="" style="color:#000000;background-color:#ffffff;">        # Force HTTP/1.1 over proxy and its Keep-Alive functionality
</span><br style="" class="">        proxy_http_version 1.1;
<br style="" class="">        proxy_set_header Connection "";
<br style="" class="">
<br style="" class="">        # Disable request buffering so requests go immediately to server
<br style="" class="">        proxy_request_buffering off;
<br style="" class="">
<br style="" class="">        # Timeouts
<br style="" class="">        # Connect, Send Normal Timeout (60 seconds) OK
<br style="" class="">        # Proxy Back-end Timeout (10m default) probably needs to be long
<br style="" class="">        # Read/Client Send Timeout (60 second default) must be very long
<br style="" class="">        proxy_timeout 3600;
<br style="" class="">        proxy_connect_timeout 1800;
<br style="" class="">        proxy_read_timeout 1800;
<br style="" class="">        proxy_send_timeout 1800;
<br style="" class="">        send_timeout 1800;<br style="" class=""></span></div><div dir="ltr">


</div><div id="yui_3_16_0_1_1431091691014_30056"><br></div><div id="yui_3_16_0_1_1431091691014_30257">These are all applied on the location second. I've tried these setting under both the location section and the server section, but there doesn't seem to be any difference.<br></div><div id="yui_3_16_0_1_1431091691014_30256"><br></div><div id="yui_3_16_0_1_1431091691014_30230">What am I missing?</div><div id="yui_3_16_0_1_1431091691014_30231"><br></div><div id="yui_3_16_0_1_1431091691014_30232">TIA,</div><div id="yui_3_16_0_1_1431091691014_30233"><br></div><div id="yui_3_16_0_1_1431091691014_30234">Ben<br></div></div></body></html>