Nginx替换过滤文本模块实例教程

零下一度
零下一度 原创
2017-06-29 11:15:35 1485浏览
1.安装此模块需要先安装sregex运行库apt-get update;
apt-get install git make gcc -y
#Centos改成yum git clone https://github.com/agentzh/sregexcd sregex make make install cd .. git clone https://github.com/agentzh/replace-filter-nginx-modulewget http://nginx.org/download/nginx-1.2.6.tar.gz tar zxvf nginx-1.2.6.tar.gz cd nginx-1.2.6./configure --add-module=../replace-filter-nginx-module #自行加其他编译参数 make make install nginx.conf的用法举例:location /t { default_type text/html; echo abc; replace_filter 'ab|abc' X; } location / { # proxy_pass/fastcgi_pass/... # caseless global substitution: replace_filter '\d+' 'blah blah' 'ig'; replace_filter_types text/plain text/css; }

以上就是Nginx替换过滤文本模块实例教程的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。