PYTHON+DJANGO+NGINX+UWSGI Environmental Resolution Timeout 504

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.