I was having the same problem with my Ubuntu/nginx/gunicorn/django 1.9 sites on my local machine. I had two nginx files in my /etc/nginx/sites-enabled. Removing either one allowed to remaining site to work. Putting both files in ended up always going to one of the two sites. I'm not sure how it chose.
So after looking at several stack overflow questions without finding a solution I went here: http://nginx.org/en/docs/http/request_processing.html
It ends up that you can have multiple servers in one sites-enabled file, so I changed to this:
server {
listen 80;
server_name joelgoldstick.com.local;
error_log /var/log/nginx/joelgoldstick.com.error.log debug;
location / {
proxy_pass http://127.0.0.1:8002;
}
location /static/ {
autoindex on;
alias /home/jcg/code/python/venvs/jg18/blog/collect_static/;
}
}
server {
listen 80;
server_name cc-baseballstats.info.local;
error_log /var/log/nginx/baseballstats.info.error.log debug;
location / {
proxy_pass http://127.0.0.1:8001;
}
location /static/ {
autoindex on;
alias /home/jcg/code/python/venvs/baseball/baseball_stats/collect_static/;
}
}
I can now access both of my sites locally