title: Django Admin keeps returning 504 timeout ( nginx +uWSGI )
body: <p>This is my nginx configuration:</p>
  
  <pre><code>server {
      listen 80;
      listen [::]:80;
  
      root /var/www/html;
  
      index index.html index.htm index.nginx-debian.html;
  
      server_name www.nameOfSite.id nameOfSite.id;
  
      access_log  off;
      error_log  /var/www/log_nginx/error.log;   
      gzip on;
      gzip_disable "msie6";
  
      client_header_timeout 180s;
      client_body_timeout 180s;
      client_max_body_size 100m;
  
      proxy_connect_timeout   120s;
      proxy_send_timeout      180s;
      proxy_read_timeout      180s;
      send_timeout            600s;
  
      gzip_vary on;
      gzip_proxied any;
      gzip_comp_level 6;
      gzip_buffers 16 8k;
      gzip_http_version 1.1;
      gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  
      location /static {    
          alias /var/www/django/static;    
      }
  
      location /media {    
         alias /var/www/django/media;    
      }
  
      location / {
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          include         uwsgi_params;
          uwsgi_read_timeout 500;
          uwsgi_send_timeout 500;
          uwsgi_pass      unix:/var/www/uwsgi_texas.sock;
      }
  
  }
  </code></pre>
  
  <p>This is my uWSGI ini file in /var/www/texas_uwsgi.ini:</p>
  
  <pre><code>[uwsgi]
  socket = /var/www/uwsgi_texas.sock
  chdir = /var/www/django/
  wsgi-file = /var/www/django/django/wsgi.py
  processes = 8
  threads = 1
  master = true
  harakiri = 900
  chmod-socket = 777
  vacuum = true
  </code></pre>
  
  <p>This is my service file in /etc/systemd/system/texas.service:</p>
  
  <pre><code>[Unit]
  Description=TEXAS
  After=syslog.target
  
  [Service]
  ExecStart=/usr/local/bin/uwsgi --ini /var/www/texas_uwsgi.ini
  Restart=always
  KillSignal=SIGQUIT
  Type=notify
  StandardError=syslog
  NotifyAccess=main
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>The problem is when i enter the Django admin for one Model object that have a lot of inline objects and fields, it keeps returning 504 timeout because it takes more than 60 seconds to process. I checked my NGINX, uWSGI configurations, i cannot find the solution on how to increase this "60 seconds timeout". The rest of the pages works fine.</p>
  
  <p>In my nginx configuration, i already tried: </p>
  
  <pre><code>proxy_connect_timeout   120s;
  proxy_send_timeout      180s;
  proxy_read_timeout      180s;
  send_timeout            600s;
  uwsgi_read_timeout 500;
  uwsgi_send_timeout 500;
  </code></pre>
  
  <p>This is the result when i try to open that Model Admin page: </p>
  
  <p><a href="https://i.stack.imgur.com/kuEhA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kuEhA.jpg" alt="the error"></a></p>