最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
nginx实现html页面中加入代码配置
时间:2022-06-30 18:44:41 编辑:袖梨 来源:一聚教程网
sub_filter功能是ngx_http_sub_module模块实现的,这个模块并不是nginx默认就会安装的,需要你在编译的时候使用–with-http_sub_module参数编译。
ngx_http_sub_module的使用很简单,共有4个参数:
| 代码如下 | 复制代码 |
| syntax: sub_filter string replacement; default: — context: http, server, location |
|
这个参数指明了用replacement替换string匹配的字符串
| 代码如下 | 复制代码 |
| syntax: sub_filter_last_modified on | off; default: sub_filter_last_modified off; context: http, server, location This directive appeared in version 1.5.1. |
|
这个参数指明了替换的时候修改响应头部的"Last-Modified",默认是关闭的。
| 代码如下 | 复制代码 |
| syntax: sub_filter_once on | off; default: sub_filter_once on; context: http, server, location |
|
这个参数指明了是匹配一次还是匹配多次,默认是匹配多次。
| 代码如下 | 复制代码 |
| syntax: sub_filter_types mime-type ...; default: sub_filter_types text/html; context: http, server, location |
|
这个参数指明了哪种类型的响应允许被替换,默认是text/html,*代表所有MIME type。
反映到我们添加统计代码的需求上,我们只需要配置sub_filter参数即可。
sub_filter
相关文章
- 华为 WS550 无线路由器无线桥接设置指南 08-14
- 华为 A1 Lite 无线路由器设置MAC地址克隆操作流程 08-14
- 华为 A1 Lite 无线路由器通过WiFi中继连接老路由器操作流程 08-14
- 华为 荣耀路由Pro 开启游戏加速功能使用 08-14
- 华为 WS832 无线路由器手机设置 08-14
- 360路由器插件网速慢怎么办(360路由器插件网速慢如何解决) 08-14