nginx configuration file:
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;
}
}
File configuration of uwsgi:
[uwsgi]
socket = 127.0.0.1:8000
plugins = python
chidir = /PycharmProjects/Flask
wsgi-file = app.py
callable = app
Flask Code:
-sharp!/usr/bin/env python
-sharp -*- 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)
Why enter 127.0.0.1 Bad Gateway 80 in the browser and return the result: 502 QR
where is the configuration wrong?