Created
May 29, 2014 00:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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