Nginx timeouts when uWSGI takes long to process request

前端 未结 4 1318
暗喜
暗喜 2021-01-31 15:05

I have Nginx + uWSGI for Python Django app.

I have the following in my nginx.conf:

location / {
    include uwsgi_params;
    uwsgi_pass            


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 15:46

    The configuration that solves the problem is:

    location / {
        include uwsgi_params;
        uwsgi_pass   127.0.0.1:9001;
        uwsgi_read_timeout 300;
        index  index.html index.htm;
    }
    

    The reason the above configuration in the question did not work for us because unfortunately in our machine multiple paths had nginx.conf file. We were working with the conf at the wrong path.

    To correctly figure out which path your nginx is picking up the configuration from run:

    nginx -V  # V is caps
    

    this will have a --conf-path=[] which will tell you exactly from where it is picking up the configuration from.

    I recently found the above nginx -V to not give the right info. I will leave the above just in case others find it useful.

提交回复
热议问题