Created
May 13, 2015 22:30
-
-
Save seanmavley/79b9f03dd6c10572f25c to your computer and use it in GitHub Desktop.
If it works... Keep it!
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
upstream app_server { | |
server 127.0.0.1:9000 fail_timeout=0; | |
} | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
# root /usr/share/nginx/html; | |
root /home/portfolio; | |
index index.html index.htm; | |
client_max_body_size 4G; | |
server_name khophi.co www.khophi.co; | |
error_log /home/nginx/nginx_error.log warn; | |
keepalive_timeout 5; | |
# Your Django project's media files - amend as required | |
location /media { | |
alias /home/portfolio/media; | |
} | |
# your Django project's static files - amend as required | |
location /static { | |
# alias /home/django/django_project/django_project/static; | |
alias /home/portfolio/static; | |
} | |
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { | |
expires 30d; | |
} | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://app_server; | |
} | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_comp_level 6; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; | |
gzip_proxied any; | |
gzip_types text/plain aplication/xml text/css tex/js text/xml application/x-javascript text/javascript application/javascript application/json app$ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment