伪静态nginx的location ~ .*.(?:htm|html)${root ydj expires -1;add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }转换为apache
时间: 2023-02-21 15:35:35 浏览: 77
在Apache中,您可以使用以下代码转换伪静态nginx的location ~ .*.(?:htm|html)$配置:
```
<FilesMatch "\.(htm|html)$">
Header set Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"
ExpiresActive On
ExpiresDefault "access plus -1 seconds"
</FilesMatch>
```
相关问题
nginx的location ~ .*.(?:htm|html)${root ydj expires -1;add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }转换为apache
Apache 的相应配置如下:
```
<FilesMatch "\.(htm|html)$">
Header set Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"
Header set Expires "-1"
</FilesMatch>
```
nginx的location ~ .*.(?:htm|html)${root jimei-admin expires -1;add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }转换为apache
在 Apache 中,这段 Nginx 的配置可以转换为下面的形式:
```
<FilesMatch "\.(htm|html)$">
Header set Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"
ExpiresActive On
ExpiresDefault "access plus 0 seconds"
</FilesMatch>
```
注意:Apache 中的 `Expires` 指令需要 mod_expires 模块的支持。如果未安装该模块,可以通过启用它来添加支持,或者使用其他方法(例如 mod_headers)来设置缓存控制头。
阅读全文