Flask, nginx, and uwsgi

前端 未结 2 1960
逝去的感伤
逝去的感伤 2021-01-13 07:08

My flask app looks like this...
myapp.py

from flask import Flask  
app = Flask(__name__) 

@app.route(\"/\")  
def hello():  
   return          


        
2条回答
  •  爱一瞬间的悲伤
    2021-01-13 08:09

    unix sockets are filesystem objects, so nginx need write permissions to /tmp/uwsgi.sock

    You are running uWSGI as root (why ???) so /tmp/uwsgi.sock will be owned by root while nginx generally runs as nobody or www-data.

    If you do not want to take in account permissions just use TCP sockets, but obviously do not run your app as root.

提交回复
热议问题