Last active
December 18, 2015 16:39
-
-
Save guillaumepiot/5813443 to your computer and use it in GitHub Desktop.
NGINX - Default site vhost
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
# Redirect from www to nothing if not accepting domain name only | |
server { | |
server_name www.<domain-name>; | |
rewrite ^(.*) http://<domain-name>$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name <domain-name>; | |
error_log /var/www/<mysitename>/logs/error.log; | |
root /var/www/<mysitename>/; | |
location /static/ { | |
autoindex off; | |
root /var/www/<mysitename>/<repo-name>/; | |
} | |
location /media/ { | |
autoindex off; | |
root /var/www/<mysitename>/<repo-name>/; | |
} | |
location / { | |
include uwsgi_params; | |
uwsgi_param SCRIPT_NAME ""; | |
uwsgi_pass 127.0.0.1:<wsgi_port>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment