1.安装此模块需要先安装sregex运行库apt-get update;
apt-get install git make gcc -y
#Centos改成yumgit clone https://github.com/agentzh/sregexcd sregexmakemake installcd ..git clone https://github.com/agentzh/replace-filter-nginx-modulewget http://nginx.org/download/nginx-1.2.6.tar.gztar zxvf nginx-1.2.6.tar.gzcd nginx-1.2.6./configure --add-module=../replace-filter-nginx-module #自行加其他编译参数makemake installnginx.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替换过滤文本模块实例教程的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3165811.html