nginx的location ~ .*.(?:htm|html)${root jimei-admin expires -1;add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }转换为apache
时间: 2023-02-21 15:14:27 浏览: 56
下面是 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 模块并已启用。
nginx的location ~ .*.(?:htm|html)${root jimei-admin }转换为apache
Apache 的相应配置如下:
```
<Directory "/var/www/jimei-admin">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<FilesMatch "\.(htm|html)$">
Options -Indexes
Require all granted
</FilesMatch>
```