我正在开发我的应用程序堆栈,使用NGINX作为Web服务器,uWSGI作为Raspbian Pixel上的应用程序服务器。当我在浏览器中调用服务器时,我收到“内部服务器错误”。 我的lab_app_nginx.conf看起来像这样。
server {
listen 80;
server_name localhost;
charset utf-8;
client_max_body_size 75M;
location /static {
root /var/www/lab_app/;
}
location / { try_files $uri @labapp; }
location @labapp {
include uwsgi_params;
uwsgi_pass unix:/var/www/lab_app/lab_app_uwsgi.sock;
}}
我的lab_app_uwsgi.ini
[uwsgi]
#application's base folder
base = /var/www/lab_app
#python module to import
app =/var/www/lab_app/hello1.py
module = %(app)
home = %(base)/venv
pythonpath = %(base)
#socket file's location
socket = /var/www/lab_app/%n.sock
#permissions for the socket file
chmod-socket = 666
callable = app
我的hello1.py
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=80)
以下是日志文件的内容
[pid: 1103|app: -1|req: -1/1] 192.168.10.12 () {38 vars in 650 bytes} [Tue Jun 20 23:38:40 2017] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
--- no python application found, check your startup logs for errors ---
可能是什么问题