【Nginx】Nginx 配置 访问本地目录

 

server {
listen 80;
server_name me.runhemei.com;
root D:\目录;
gzip on;
gzip_min_length 1024;
gzip_buffers 4 8k;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";

location ^~ /maochao/ {
charset utf-8;
root D:\目录;
add_header X-Cache $upstream_cache_status;
proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
expires 3d;
}
}