I need to serve up two webs apps (Django) on gunicorn under different domain names using nginx on ubuntu. I started using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
It worked just fine for one using that. Then I tried to do the same thing for the second but it gives me a 502 gateway for the second domain. So I tried following this tutorial: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
I'm at the part where you run the gunicorn start script:
sudo bin/gunicorn_start
I get back the response:
Starting webuildblack as root
Traceback (most recent call last):
File "/home/devin/webuildblack/bin/gunicorn", line 7, in <module>
from gunicorn.app.wsgiapp import run
ImportError: No module named 'gunicorn.app'; 'gunicorn' is not a package
502 gatewayproblem first. You could check nginx logs and run django in debug mode to see more information about problem. Sometimes it can be simple problem like problem with database.