My flask app looks like this...
myapp.py
from flask import Flask
app = Flask(__name__)
@app.route(\"/\")
def hello():
return
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.
You can have a look on this: Python flask with Nginx and uWSGI as the repo provides the exact case / scenario on how to use Flask in production mode.