title: Nginx + UWSGI + Flask 504 gateway timeout error
body: <p>I have a problem with nginx+uwsgi.I am getting 504 bad gateway error exactly after 60 seconds after calling Flask Rest API. Following are the contents of some nginx configurations.Am I missing something or Do I need to make any changes in config files</p>
  <p><strong>/etc/nginx/conf.d/nginx.conf</strong> content</p>
  <pre><code>server {
      listen 6611;
      #ssl_certificate /cert/host.pem;
      #ssl_certificate_key /cert/host.key;
      underscores_in_headers on;
      location / {
          try_files $uri @app;
          proxy_send_timeout 3000;
          proxy_connect_timeout 3000;
          proxy_read_timeout 3000;
          uwsgi_read_timeout 3000;
          uwsgi_connect_timeout 3000;
          uwsgi_send_timeout 3000;
          client_body_timeout 3000;
      }
      location @app {
          include uwsgi_params;  
          uwsgi_pass unix:///tmp/uwsgi.sock;
      }
      error_log /var/log/nginx/test.dev.error.log;
      access_log /var/log/nginx/test.dev.access.log;
      location /static {
          alias /static;
      }
  }
  </code></pre>
  <p><strong>/etc/nginx/nginx.conf</strong> content</p>
  <pre><code>worker_processes 5;
  error_log  /var/log/nginx/error.log warn;
  pid        /tmp/nginx.pid;
  events {
      worker_connections  1024;
  }
  
  http {
      include       /etc/nginx/mime.types;
  #    include       /etc/nginx/proxy.conf;
      default_type  application/octet-stream;
      log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
                        '$status $body_bytes_sent &quot;$http_referer&quot; '
                        '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';
      access_log  /var/log/nginx/access.log  main;
      sendfile        on;
      #tcp_nopush     on;
      keepalive_timeout  65;
      #gzip  on;
      include /etc/nginx/conf.d/*.conf;
      proxy_temp_path /tmp/proxy_temp;
      client_body_temp_path /tmp/client_temp;
      fastcgi_temp_path /tmp/fastcgi_temp;
      uwsgi_temp_path /tmp/uwsgi_temp;
      scgi_temp_path /tmp/scgi_temp;
  }
  daemon off;
  </code></pre>
  <p>Thanks in advance</p>