HAProxy community

Rewrite only part of response header


#1

Hi all!

I have response header:

Location: https://app1.prod.domain.com/devops2/login/userStart?pageUUID=54190a4f-1e89-43b4-ba53-e581e5fc6bf4&userId=&uuidValue=8cad8415-d1ae-4396-8e1a-ac1620a7755a&loginAction=true

I need rewrite and result this:

Location: https://app1.stage.domain.com/devops2/login/userStart?pageUUID=54190a4f-1e89-43b4-ba53-e581e5fc6bf4&userId=&uuidValue=8cad8415-d1ae-4396-8e1a-ac1620a7755a&loginAction=true

#2

Something like this should do it:

http-response replace-header Location https:\/\/app1\.prod\.domain\.com/(.*) https://app1.stage.domain.com/\1