我正在使用uWSGI使用uwsgi --http-socket 127.0.0.1:3031 -w app:app
來提供我的應用程序,當我在瀏覽器中訪問127.0.0.1:3031
時,它適用。我想使用Nginx,所以我告訴它uwsgi_pass
該網址,但現在我得到一個502錯誤的網關錯誤。我如何將uWSGI放在Nginx之後?將uWSGI HTTP服務器轉換爲Nginx的後臺
server {
listen 8080;
server_name 127.0.0.1;
location/{
uwsgi_pass 127.0.0.1:3031;
include uwsgi_params;
}
location /static {
alias /static/folder/location;
}
}
2016/05/16 19:50:09 [error] 6810#0: *4 upstream prematurely closed
connection while reading response header from upstream, client:
127.0.0.1, server: 127.0.0.1, request: "GET/HTTP/1.1", upstream:
"uwsgi://127.0.0.1:3031", host: "127.0.0.1:8080"