账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    nginx+uwsgi配置
    39
    0

    nginx配置文件:

    server {
        listen 80;
        server_name 127.0.0.1; 
        charset  utf-8;
        index index.html index.htm index.nginx-debian.html;
        client_max_body_size 75M;
    
        location / {
            include uwsgi_params;
            uwsgi_pass 127.0.0.1:8000;
            uwsgi_param UWSGI_PYTHON /PycharmProjects/Flask/venv;
            uwsgi_param UWSGI_CHDIR /PycharmProjects/Flask;
            uwsgi_param UWSGI_SCRIPT run:app;
                
        }
    }
    

    uwsgi的文件配置:

    [uwsgi]                                                     
    socket = 127.0.0.1:8000                         
    plugins = python                                        
    chidir = /PycharmProjects/Flask                                   
    wsgi-file = app.py                                       
    callable = app 
    
    
    

    Flask代码:

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    from flask import Flask
    app = Flask(__name__)
    @app.route("/")
    def hello():
        return "Hello World!"
    if __name__ == "__main__":
        app.run(host='0.0.0.0', port=8080)
    

    为什么在浏览器里面输入:127.0.0.1:80返回结果是:502 Bad Gateway
    是哪里配置的不对吗?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 單身夢 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部