在UWSGI和NGINX配合的情况下,配置个别目录上传及超时

时间:2021-10-27 16:58:38

笨办法就是多加一个LOCATION。

然后,自定义以下类似参数

client_max_body_size
uwsgi_connect_timeout
uwsgi_read_timeout
server {
        listen       80;
        server_name  localhost;

        location / {
            include  uwsgi_params;
            uwsgi_pass  prism_host;
            uwsgi_param UWSGI_SCRIPT P.wsgi;
            uwsgi_param UWSGI_CHDIR /P/P;
            index  index.html index.htm;
            # client_max_body_size 1000m;
            uwsgi_connect_timeout 300;
            # uwsgi_write_timeout 300;
            uwsgi_read_timeout 300;
        }
	location  /version/file_upload/ {
            include  uwsgi_params;
            uwsgi_pass  prism_host;
            uwsgi_param UWSGI_SCRIPT P.wsgi;
            uwsgi_param UWSGI_CHDIR /P/P;
            index  index.html index.htm;
            client_max_body_size 1000m;
            uwsgi_connect_timeout 3000;
            # uwsgi_write_timeout 300;
            uwsgi_read_timeout 3000;
        }
	location ^~ /static {
            	root /P/P;
        }
    }