Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
Created May 29, 2014 00:20
Show Gist options
  • Save bradmontgomery/3c46983d5412ac7a8706 to your computer and use it in GitHub Desktop.
Save bradmontgomery/3c46983d5412ac7a8706 to your computer and use it in GitHub Desktop.
My nginx config for development. I use this in a vagrant vm (ubuntu), to proxy to the django development server (which runs on port 8888). Based on http://www.peterbe.com/plog/local-django-development-with-nginx
server {
listen 8000;
root /vagrant/MY_PROJECT/static;
# My vm's host name is 'appserver'
server_name appserver;
access_log /var/log/nginx/access.log;
gzip off;
location /static {
alias /vagrant/MY_PROJECT/static;
}
proxy_set_header Host $http_host;
location / {
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8888;
add_header X-Static miss;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment