By Flareloop
Connected Tutorial(This question is a follow-up to this tutorial):
How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 20.04Hi,
Followed the tutorial on Flask/Gunicorn/Nginx/Ubuntu20.04 and am having a problem at the point where Nginx connects to the myproject.socket file. Client request results in an error in /var/log/nginx/error that reports ‘Permission denied’:
*3 connect() to unix:/home/user/myproject/myproject.sock failed (13: Permission denied) while connecting to upstream, client: …, server: … , request: “GET / HTTP/1.1”, upstream: “http://unix:/home/user/myproject/myproject.sock:/”, host: “…”
Have tried 777 permissions on the socket file and changes to the permission on the parent dir with no success. Any ideas? Could it be an issue with the www-data user’s memberships?
DC
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I have the exact same problem. So assuming your DNS settings are okay, the solution is simple: Set up based on https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-20-04 but as a User and not as root. :)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.