I am trying to setup nginx to pass to a gunicorn backend to run a Django project. Unfortunately, I cannot seem to get nginx to display anything other than the welcome page, seemingly no matter what I try.
- Tried both a sites-enabled approach as well as a monolithic nginx.conf approach
- Confirmed that nginx is actually reading my nginx.conf--if I put gibberish in the file, it will refuse to start, complaining about the gibberish
- Removed the 'default' config in sites-enabled
- Confirmed that gunicorn started successfully
My nginx.conf is as follows:
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
#include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/sites-enabled/*;
}
And in sites-available, I have the file "localhost". This file is then symlinked into sites-enabled.
server {
listen 80 default_server;
server_name localhost;
access_log /srv/www/menus-dev/logs/access.log;
error_log /srv/www/menus-dev/logs/error.log;
root /srv/www/menus-dev/http;
location / {
proxy_pass http://127.0.0.1:8888;
}
location /static {
root /srv/www/menus-dev/static_files;
}
}
Any suggestions? I am banging my head against the wall on this one. Everything tells me this should work just fine, but I just cannot get it running.
This is running on an Ubuntu Precise 32-bit Vagrant VM (virtualbox) for what it's worth.