在Apache和Nginx反向代理中实现输出内容替换例子
时间:2012-09-24 05:06来源:未知 作者:最模板 点击:次
Apache 例子: RequestHeaderunsetAccept-Encoding ExtFilterDefinefixtextmode=outputintype=text/htmlcmd= /bin/sed.exes/原字符1/目标字符1/g ExtFilterDefinefixtext1mode=outputintype=text/htmlcmd= /bin/sed.exes/原字符2/目标字符2/g
Apache 例子:
- RequestHeader unset Accept-Encoding
- ExtFilterDefine fixtext mode=output intype=text/html cmd="/bin/sed.exe s/原字符1/目标字符1/g"
- ExtFilterDefine fixtext1 mode=output intype=text/html cmd="/bin/sed.exe s/原字符2/目标字符2/g"
- SetOutputFilter fixtext;fixtext1
Nginx例子
- sub_filter '原字符' '目标字符';
- sub_filter_once off;
- proxy_set_header Accept-Encoding "";
(责任编辑:最模板) |
------分隔线----------------------------