Posts

Showing posts with the label httpbackend

HAProxy and reqrep path rewriting with redirect configuration

HAProxy and reqrep path rewriting with redirect configuration With HA Proxy 1.5 I need to rewrite URL from http://main.domain.com/my-foo to http://othersite.com:8081/other-bar http://main.domain.com/my-foo http://othersite.com:8081/other-bar Here is what I tried: frontend ft_def bind :80 mode http acl has_special_uri path_beg /my-foo use_backend def if has_special_uri default_backend def backend def mode http option forwardfor reqirep ^([^ ]* )/my-foo(.*) 1/other-bar2 server myserver othersite.com:8081 This works: URL http://main.domain.com/my-foo/home.html becomes http://othersite.com:8081/other-bar/home.html http://main.domain.com/my-foo/home.html http://othersite.com:8081/other-bar/home.html and in the browser the initial URL http://main.domain.com/my-foo/home.html appears. http://main.domain.com/my-foo/home.html I...