Nginx + UWSGI + Flask 504 gateway timeout error

Viewed 1171

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

/etc/nginx/conf.d/nginx.conf content

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;
    }
}

/etc/nginx/nginx.conf content

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] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    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;

Thanks in advance

0 Answers
Related