不让 nginx 缓存 html、htm

Nihaorz / 2023-05-08 / 原文

location / {
    if ($request_filename ~* .*\.(?:htm|html)$) {
        add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
    }
    root   html;
    index  index.html index.htm;
}