我在尝试使用uwsgi配置nginx时遇到了问题。
我通过以下命令启动uwsgi:
uwsgi --plugin python,http --socket 127.0.0.1:8080 --wsgi-file hello.py --callable app --masternginx.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主页,而不是我的网页。
我主要遵循了上面提到的here步骤
发布于 2015-01-01 22:03:47
编辑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。
https://stackoverflow.com/questions/24879044
复制相似问题