我试图通过uWSGI在Nginx上提供Flask应用程序(首次使用Nginx for Flask)。
Nginx配置看起来像:
server {
listen 80;
location / {
include uwsgi_params;
uwsgi_pass flask:5555;
}
client_max_body_size 100M;
client_header_timeout 120s;
client_body_timeout 120s;
keepalive_timeout 120s;
send_timeout 120s;
}
和uWSGI
wsgi-file = run.py
callable = app
socket = :5555
processes = 4
threads = 2
master = true
chmod-socket = 660
vacuum = true
die-on-term = true
但无论如何,具有较大有效负载的Flask应用都会在1分钟后在Nginx一侧超时。
从终端运行时,Flask应用程序可以正常运行。
有什么提示吗?
解决了它在添加超时到uWSGInginx.conf
为
server {
listen 80;
location / {
include uwsgi_params;
uwsgi_pass flask:5555;
uwsgi_read_timeout 300;
}
client_max_body_size 100M;
client_header_timeout 120s;
client_body_timeout 120s;
keepalive_timeout 120s;
send_timeout 120s;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句