nginx配置不缓存html文件
server {listen80;charset utf-8;keepalive_timeout300;client_max_body_size50m;server_namepj-feedback.sany.com.cn;location / {root /data/html/**;# 配置页面不缓存html和htm结尾的文件if ($request_filename ~* .*\.(?:
·
server {
listen 80;
charset utf-8;
keepalive_timeout 300;
client_max_body_size 50m;
server_name pj-feedback.sany.com.cn;
location / {
root /data/html/**;
# 配置页面不缓存html和htm结尾的文件
if ($request_filename ~* .*\.(?:htm|html)$)
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
index index.html index.htm;
# 配置支持跨域
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = 'OPTIONS') {
return 204;
}
}
}
更多推荐
已为社区贡献5条内容
所有评论(0)