Reputation: 341
I am working on django+gunicorn+nginx. In the django admin, i am trying to delete an item 'user', which links to quite a lot of data in database, and it returns ' 504 Gateway Time-out' after 60 seconds. Then I tried on changing the config of nginx and the one of gunicorn as below
in gunicorn:
timeout = 10000
and in nginx
proxy_connect_timeout 50000;
proxy_read_timeout 50000;
proxy_send_timeout 50000;
But no matter what i have changed, the server always timeout after 60 seconds!
What can i do? I am total clueless...
And also the server is down too, i can't even ssh into it. looks not a nginx/gunicorn config problem?
ngix.conf
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
sites-enabled/app.conf
location / {
try_files $uri @app;
}
location @app {
proxy_connect_timeout 50000;
proxy_read_timeout 50000;
proxy_send_timeout 50000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://xxx;
}
Upvotes: 2
Views: 3858
Reputation: 139
Set the timeout ngnix setings into the http{ ... } block in /etc/nginx/nginx.conf file:
http {
#All block content...
#Now the timeout settings:
proxy_connect_timeout 50000;
proxy_read_timeout 50000;
proxy_send_timeout 50000;
}
Restart nginx
Upvotes: 1