server {
listen 8080 ;
server_name 192.168.1.12;
location / {
root /opt/web/spa;
index index.html index.htm;
if ($request_filename ~* .*\.(htm|html)$) ## 配置页面不缓存
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
}
location /cc-admin {
proxy_connect_timeout 10s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_pass http://localhost:8888/cc-admin;
proxy_redirect off;
client_max_body_size 200m;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
nginx 禁止 html缓存
最新推荐文章于 2024-02-28 14:54:48 发布