我试图通过在瓶子框架上运行的uwsgi设置nginx。我不断收到502错误的网关,并且nginx错误日志显示9066#0:* 13从上游读取响应标头时,上游过早关闭了连接,
9066#0: *13 upstream prematurely closed connection while reading response header from upstream, client: "ip address", server: "mydomain", request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/myapp.sock:", host: "mydomain"
uwsgi .ini文件
[uwsgi]
module = run:application
master = true
processes = 1
uid = jimmy
gid = nginx
socket = /run/uwsgi/myapp.sock
chown-socket = jimmy:nginx
chmod-socket = 660
vacuum = true
die-on-term = true
nginx配置
user jimmy;
worker_processes 1;
#error_log logs/error.log; #error_log logs/error.log notice;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 20M;
keepalive_timeout 0;
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
server {
# for a public HTTP server:
listen 80;
server_name "mydomain";
location / {
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/myapp.sock;
}
在我的瓶子run.py文件中
application = bottle.default_app()
我花了很长时间进行谷歌搜索,但仍然无法使nginx工作。任何帮助将不胜感激。