1# vi:filetype=perl 2 3use lib 'lib'; 4use Test::Nginx::LWP; 5 6plan tests => repeat_each() * 2 * blocks(); 7$ENV{TEST_NGINX_BACKENDS_PORT} ||= "www.taobao.com:80"; 8no_root_location(); 9 10#no_diff; 11 12run_tests(); 13 14__DATA__ 15 16=== TEST 1: the "fix string substitution" command 17--- http_config 18 19 upstream backends { 20 server $TEST_NGINX_BACKENDS_PORT; 21 } 22 23--- config 24 25 location / { 26 subs_filter 'taobao.com' 'yaoweibin'; 27 proxy_set_header Host 'www.taobao.com'; 28 proxy_pass http://backends; 29 } 30--- request 31 GET / 32--- response_body_unlike: ^(.*)taobao\.com(.*)$ 33