uwsgi&x2B;nginx配置-nginx未连接到uwsgi
我无法使用uwsgi配置nginx 我通过以下方式启动uwsgi:uwsgi&x2B;nginx配置-nginx未连接到uwsgi,nginx,flask,uwsgi,Nginx,Flask,Uwsgi,我无法使用uwsgi配置nginx 我通过以下方式启动uwsgi: uwsgi --plugin python,http --socket 127.0.0.1:8080 --wsgi-file hello.py --callable app --master nginx.conf: upstream uwsgicluster { server 127.0.0.1:8080; } server { # Running port
uwsgi --plugin python,http --socket 127.0.0.1:8080 --wsgi-file hello.py --callable app --master
nginx.conf:
upstream uwsgicluster {
server 127.0.0.1:8080;
}
server {
# Running port
listen 80;
# Settings to by-pass for static files
location /static/ {
alias /home/ubuntu/projects/conradlabs_wow/wowcFlask/static/;
}
# Proxying connections to application servers
location / {
include uwsgi_params;
uwsgi_pass uwsgicluster;
}
}
当我点击ip时,我仍然会得到默认的nginx主页,而不是我的网页
我主要遵循了前面提到的步骤编辑
nginx.conf
或/etc/nginx/vhosts.d/example.conf
server {
listen 80;
server_name example.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8080;
proxy_redirect off;
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;
}
}
重新启动nginx。您能看到站点在localhost:8080和curl上运行吗?我建议不加载此配置文件是的,部署在uwsgi上的应用程序可以在端口8080上访问(当我使用--http 0.0.0:8080时,我可以在任何地方访问该网页),但提供默认的nginx主页,而不是运行在uwsgi 8080上的应用程序。您是如何安装nginx的?此外,vhost配置在哪里?