Created
September 5, 2019 04:50
-
-
Save daimon99/d6463648f5e3e8fd9423a95d4ac5cbb0 to your computer and use it in GitHub Desktop.
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 80; | |
server_name essaygo.taijihuabao.com; | |
access_log /data/prd/essaygo/logs/essaygo.access.log main; | |
error_log /data/prd/essaygo/logs/essaygo.error.log warn; | |
root /data/prd/essaygo/www/; | |
gzip on; | |
gzip_min_length 4k; | |
gzip_comp_level 6; | |
gzip_types text/plain application/x-javascript text/css application/xml application/javascript application/json; | |
gzip_vary on; | |
gzip_http_version 1.1; | |
location @django { | |
proxy_pass http://127.0.0.1:9076; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
add_header Cache-Control no-store; | |
} | |
location = / { | |
try_files /index.html @django; | |
} | |
location / { | |
try_files $uri $uri/ @django; | |
} | |
location /static { | |
alias /data/prd/essaygo/staticfiles; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment