title: 504 error when the view loading takes more than 5 s
body: <p>I've got an installation with <strong>django-nginx-gunicorn-supervisor-postgresql</strong>. In the Django admin, I've got a 504 if the loading of the view takes more than around 5 seconds.</p>
  
  <p>For instance, if I filter a change list view with many records and takes more than that time, the 504 appears. The same view with fewer records works, as long as it takes less time.</p>
  
  <p>I've noticed also that some views are still running in the background, even after the 504, cause I can see the modifications they make in the database after they finish.</p>
  
  <p>I've tried to increase all timeouts I've found (nginx, gunicorn), but none of them was configured to 5 seconds. <strong>Any guess of what could be misconfigured? Or where could be the timeout that raises the 504?</strong></p>
  
  <p>Thanks</p>
  
  <p>The timeouts I've configured are:</p>
  
  <p>In /etc/nginx/sites-enabled/mysite</p>
  
  <pre><code>proxy_connect_timeout 60;
  proxy_read_timeout 90;
  proxy_send_timeout 90;
  send_timeout 90;
  fastcgi_read_timeout 300;
  </code></pre>
  
  <p>In /etc/nginx/nginx.conf</p>
  
  <pre><code>send_timeout 300;
  keepalive_timeout 65;
  proxy_connect_timeout 300;
  proxy_read_timeout 300;
  proxy_send_timeout 300;
  </code></pre>
  
  <p>In the gunicorn_start file (launched by supervisor)</p>
  
  <pre><code>exec gunicorn -c ${CONF_FILE} ${DJANGO_WSGI_MODULE}:application \
          --name ${NAME} \
          --user=${USER} --group=${GROUP} \
          --log-level=debug \
          --timeout=90
  </code></pre>
  
  <p>In the gunicorn.conf file (previous ${CONF_FILE})</p>
  
  <pre><code>timeout = 90
  graceful_timeout = 30
  keepalive = 3
  </code></pre>