Http://www.linuxyw.com/470.html
My operation and maintenance system is developed with Python+django, running in NGINX+UWSGI environment
System has part of the function is to update the game program, etc., if the file more or larger time, may need to wait longer, if nginx use the default configuration, generally 60 seconds will appear timeout 504, if the system in 60 seconds did not return results, it is timeout 504, it will affect the use of the system.
Here is a brief description of how to modify the nginx.conf configuration file to prevent timeout 504:fastcgi_connect_timeout 300; Fastcgi_send_timeout 300; Fastcgi_read_timeout 300; Fastcgi_buffer_size 256k; #以下四个参数已加大, timeout 504 fastcgi_buffers 256k is also present if the setting is too small; Fastcgi_busy_buffers_size 512k; Fastcgi_temp_file_write_size 512k;
server {Listen 8002; server_name localhost;
location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; uwsgi_param UWSGI_CHDIR /python/owork; uwsgi_param UWSGI_SCRIPT Django_wsgi; access_log /data/logs/uwsgi_ Access.log; uwsgi_read_timeout 1800; uwsgi_send_timeout 300; proxy_read_timeout 300; location ^~ /static { alias /python/ owork/pro/static/; }
}