Skip to main content

Posts

Showing posts with the label http

uri modificatin on http response

In haproxy : cannot. In nginx : possible. Backend Host: 1.2.3.4 Frontend Host: 2.2.2.2         location ^~ /its/         {             proxy_buffering   off;             rewrite           /its/(.*) /$1 break;             proxy_pass        http://1.2.3.4/;             proxy_redirect    default;             sub_filter_once off;             sub_filter ' href="/' ' href="/its/';             sub_filter ' src="/' ' src="/its/';             sub_filter ' src="http://1.2.3.4/' ' src="/its/';             sub_filter ' action="/' ' action="/its/';         } ex1. 2.2.2.2/its --> (2.2.2.2 connect to 1.2.3.4 ) 1.2.3.4/ 2.2.2.2/its/xxx <-- (2.2.2.2 response by 1.2.3.4 ) 1.2.3.4/xxx ex2. 2.2.2.2/its/aaa --> (2.2.2.2 connect to 1.2.3.4 ) 1.2.3.4/aaa 2.2.2.2/its/xxx <-- (2.2.2.2 response by 1.2.3.4 ) 1.2.3.4/xxx