Report this

What is the reason for this report?

I'm having trouble setting up nginx with gunicorn and django for multiple websites

Posted on October 30, 2016

So I followed this tutorial because part two tells how to do it for multiple websites and domains (http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/) and everything went smoothly till the end when I erase the default config for mine in sites-available and sites-enabled the restart nginx. When I navigate to my site I get a “site cant be reached” error. I created the link for new config to sites-enabled from sites-available. supervisorctl says its running my gunicorn start script when I check the status. What I notice though is that at no point is gunicorn.sock created in the run directory. Am I supposed to create that? I tried that but to no avail. Can someone help



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Did you restart nginx after linking from sotes-available to sites-enabled? What’s the nginx status after restart?

  1. sudo systemctl restart nginx
  2. sudo systemctl status nginx

You should see a lot of informations but somewhere will be status.

You can verify your nginx configuration and see is everything okay:

  1. sudo nginx -t

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.