nginx清除缓存
location ~* \.(html)$ {root /opt/public;add_header Cache-Control no-store;}location ~* \.(js|css|map|jpg|png|svg|ico)$ {root /opt/public;add_header Cache-Control "public,max-age=2592000";}
server {
listen 4200;
server_name localhost;
location ~* \.(html)$ {
root /opt/public;
add_header Cache-Control no-store;
}
location ~* \.(js|css|map|jpg|png|svg|ico)$ {
root /opt/public;
add_header Cache-Control "public,max-age=2592000";
}
location /index.html{
root /opt/public;
}
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, DELETE, PUT';
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';
root /opt/public;
try_files $uri $uri/ /index.html;
index index.html index.htm Default.htm;
}
location /status {
stub_status on;
}
location /health {
default_type text/html;
return 200 "It is ok";
}
}
}
更多推荐
所有评论(0)