Created
February 20, 2014 23:35
-
-
Save victoraguilarc/9125663 to your computer and use it in GitHub Desktop.
Django + nginx Configuration
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 80; | |
server_name www.jvacx.com jvacx.com; | |
charset utf-8; | |
access_log /home/victor/Proyectos/jvacx.com/var/log/access.log; | |
error_log /home/victor/Proyectos/jvacx.com/var/log/error.log; | |
# pass root to django | |
location / { | |
include uwsgi_params; | |
uwsgi_pass unix:///tmp/jvacx.socket; | |
# disallow .py, .wsgi, and .conf | |
} | |
# serve django static files | |
location /static { | |
root /home/victor/Proyectos/jvacx.com/public; | |
} | |
# alias robots.txt to static | |
location /robots.txt { | |
alias /home/victor/Proyectos/jvacx.com/public/static/robots.txt; | |
} | |
# alias favicon.* to static | |
location ~ ^/favicon.(\w*)$ { | |
alias /home/victor/Proyectos/jvacx.com/public/static/favicon.$1; | |
} | |
# serve django uploaded media | |
location /media { | |
root /home/victor/Proyectos/jvacx.com/public; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment