伪静态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 13:35:35 浏览: 56
在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 jimei-admin expires -1;add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }转换为apache
下面是 Nginx 中的 `location ~ .*.(?:htm|html)$` 的 Apache 相应语句:
```
<FilesMatch "\.(htm|html)$">
Header set Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"
Header set Expires "-1"
</FilesMatch>
```
请注意,在 Apache 中,使用 `Header` 设置响应头,而在 Nginx 中使用 `add_header`。
nginx的location ~ .*.(?:htm|html)${root jimei-admin expires -1; }转换为apache
Apache 的等价配置如下:
```
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus -1 seconds"
<FilesMatch "\.(html|htm)$">
ExpiresDefault "access plus -1 seconds"
</FilesMatch>
</IfModule>
```
请注意,需要确保 Apache 已经安装了 mod_expires 模块并已启用。