服务器环境 腾讯云 centos7.4 python3.6 Nginx uwsgi flask ,测试helloword总是502。。。目录:/home/www里面1个py 1个配置: m.pyuwsgiconfig.inim.py flask是直接安装的,没有虚拟环境from flask import Flask
app = Flask(__name__)@app.route('/')def home():
return 'helloword。'if __name__ == '__main__':
app.run()uwsgiconfig.ini网上复制的配置改的[uwsgi]socket= 127.0.0.1:8001pythonpath =/home/wwwmodule=mwsgi-file=/home/www/m.pycallable = appprocesses = 4threads = 2nginx网上的配置改的 include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name 58.87.112.23; #公网地址
root /usr/share/nginx/html;
# Load configuration files for the default server block.
#include /etc/nginx/default.d/*.conf;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8001;
uwsgi_param UWSGI_CHDIR /home/www;
uwsgi_param UWSGI_SCRIPT m:app;
}
}输入58.87.112.23; #公网地址出现502
添加回答
举报
0/150
提交
取消