【发布时间】:2016-07-15 11:39:48
【问题描述】:
我在 nginx 代理后面使用 gunicorn 运行烧瓶应用程序,并试图让 gaiohttp 工作人员工作。该应用程序只返回404,适用于选择Gaiohttp工作人员
时所有URL当使用同步或 gevent 工作人员时,一切正常。也不直接运行到 gunicorn 和 gaiohttp 即不使用 nginx 它工作正常。
我已经阅读了我能找到的所有内容。
我错过了什么吗?在 nginx 代理后面运行时,gaiohttp worker 是否有效?
我的 nginx 配置:
location /app {
proxy_pass http://127.0.0.1:9002;
rewrite /app(.*) /$1 break;
proxy_redirect off;
proxy_buffering on;
proxy_pass_header Server;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Script-Name /app;
}
独角兽:
/usr/bin/gunicorn --workers 2 -k gaiohttp -b 127.0.0.1:9002 app:app
使用最新版本的 gunicorn 等
【问题讨论】:
标签: python-3.x nginx flask gunicorn aiohttp