By lewisblack
Hi I’m currently trying to follow a tutorial on installing nginx with gunicorn and django. I’ve combed the web for more docs/explanation on the gunicorn.sock file, it’s contents and location.
So far all the tutorials I’ve seen include such a file, but do not explain fully their purpose. Can anyone on digital ocean shed more light on these? I’ve done a search for ‘gunicorn.sock’ on docs.gunicorn.org but I get the boilerplate ‘Your search did not match any documents…’
Thanks in advance :-)
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!
yeah i’ve had the same questions for awhile now as well. Several tutorials on deploying django, gunicorn and nginx talk about daemonizing/automating gunicorn but in the conf files, it specifies a .sock file. where is this .sock file? is it usually created automatically by whichever WSGI you choose i.e uWSGI, gunicorn? i tried to find the .sock file for my respective django app on ubuntu using find command but no luck. i want to use supervisor to automate gunicorn but i dont fully understand the conf file for superviser.
If i am running gunicorn +django app inside a docker container how will i specify this http://unix:/home/youusername/somename.sock;
I have the same question RE *.sock files, how are they created?
The documentation here (https://docs.gunicorn.org/en/stable/run.html?highlight=bind) says you can use in terminal:
GUNICORN_CMD_ARGS="unix:$HOME/somedir/appname.sock"
And also in the nginx config file in /etc/nginx/sites-available/whatever you called your config file (also symlinked to sites-enabled)
But this didn’t answer my question/solve my bad gateway error.
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.