vue flask uwsgi nginx 配置

2019-12-25  本文已影响0人  invoker2018

Mac下:

nginx

1. 启动命令: sudo nginx
2. 重启命令: sudo nginx -s reload
3. 停止命令: sudo nginx -s stop
server {
    # 监听端口
    listen 80;
    # 监听ip 换成服务器公网IP
    server_name 127.0.0.1;
 
    #动态请求
    location / {
      include uwsgi_params;
      uwsgi_pass 127.0.0.1:8000;#此端口号对应下面的uswgi内的socket
    }
    #静态请求
    location /static {
        alias /Users/xiaoyuan/Desktop/flask_test/static;

    }
}

uwsgi

[uwsgi]

chdir=/Users/xxx/sites/qcs_flask/backend
home=/Users/xxx/sites/qcs_flask/backend/venv
module=run
callable=app
master=true
processes=4
threads=2

chmod-socket=666
logfile-chmod=644
uid=qcs_flask
gid=qcs_flask
procname-prefix-spaced=qcs_flask
py-autoreload=1
socket = 0.0.0.0:8050
vacuum=true
socket=%(chdir)/uwsgi/uwsgi.sock
stats=%(chdir)/uwsgi/uwsgi.status
pidfile=%(chdir)/uwsgi/uwsgi.pid
daemonize=%(chdir)/uwsgi/uwsgi.log
#详细内容查阅文档
上一篇 下一篇

猜你喜欢

热点阅读