uwsgi and revpipyload2
Posted: 12 Apr 2021, 15:46
Hi,
I wrote a simple Flask app to control the DO output pins which work well when I am using it with the Flask built-in server... Although when I try to deploy my with Nginx + uwsgi well known reverse proxy setup it fails miserably.
When I run my app with the uwsgi with flags from command line with pi user it works and pins get action properly (uwsgi --http-socket 0.0.0.0:5000 -w io_api_app:app). Notice the --uid --gid flags are not used... As soon as I specified the user and group it stop working, for instance : uwsgi --http-socket 0.0.0.0:5000 --uid pi --gid pi -w io_api_app:app or uwsgi --http-socket 0.0.0.0:5000 --uid root --gid root -w io_api_app:app.
With uwsgi.ini file it even worse even when I don't specify the uid and gid, it just won't work... I am very puzzled on what I am doing wrong as my config work, uwsgi accept request and return proper expected response, when I include Nginx in the mix everythings from the app to nginx work properly. The only part that seem to fail is the output pins that don't get powered on or off. I try to change permissions of the Flask .py app file and uwsgi.ini. "pi" user seems to be member of the proper groups as it works as explained in the previous paragraph...
Thanks for any pointer
Richard
I wrote a simple Flask app to control the DO output pins which work well when I am using it with the Flask built-in server... Although when I try to deploy my with Nginx + uwsgi well known reverse proxy setup it fails miserably.
When I run my app with the uwsgi with flags from command line with pi user it works and pins get action properly (uwsgi --http-socket 0.0.0.0:5000 -w io_api_app:app). Notice the --uid --gid flags are not used... As soon as I specified the user and group it stop working, for instance : uwsgi --http-socket 0.0.0.0:5000 --uid pi --gid pi -w io_api_app:app or uwsgi --http-socket 0.0.0.0:5000 --uid root --gid root -w io_api_app:app.
With uwsgi.ini file it even worse even when I don't specify the uid and gid, it just won't work... I am very puzzled on what I am doing wrong as my config work, uwsgi accept request and return proper expected response, when I include Nginx in the mix everythings from the app to nginx work properly. The only part that seem to fail is the output pins that don't get powered on or off. I try to change permissions of the Flask .py app file and uwsgi.ini. "pi" user seems to be member of the proper groups as it works as explained in the previous paragraph...
Thanks for any pointer
Richard