Files
2018-01-30 00:15:41 +08:00

24 lines
793 B
Nginx Configuration File

server {
listen 80;
server_name localhost;
access_log /root/dgblogProject/djangoblog/nginx.access.log;
error_log /root/dgblogProject/djangoblog/nginx.error.log;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /favicon.ico {
alias /root/dgblogProject/djangoblog/static/img/favicon.ico;
}
location ~ ^/(media|static)/ {
root /root/dgblogProject/djangoblog;
expires 30d;
}
# this prevents hidden files (beginning with a period) from being served
location ~ /\. {
access_log off; log_not_found off; deny all;
}
}