Response Header


#1

I am using HAProxy 1.5.12 and I am trying to hide a URL header by using a response rewrite but it is not working.

When I have people go to “www.somesite.com/name/name2” I want to only display “www.somesite.com/name” in the browser bar, no matter what link they click. The link in the webpage can show but management want it to be hidden in the browser bar.

I have the an extract of the code as shown below. (speech marks are not in the config, just in this example)

frontend "www.somesite.com"
acl has_name path_beg /name
use_backend name.somesite.com if has_name
default “www.somesite.com

backend "name.somesite.com"
rspirep ^([^\ ])\ /name2(.) \1\ /\2

I have other elements in the script that work with no issues, it is just the response header which I am having issues with.

I could be looking in totally the wrong place, so any help is greatly appreciate.


#2

Hi Lee,

What Header are you trying to rewrite in the response?
How is the URL coded in the response’s body?

Baptiste