Hi All,
I am trying to upgrade the HAProxy version from 2.1 to 2.4, and as everyone’s already aware that Rspirep is no longer supported in the upgraded version. Hence, I need to use http-response replace-header instead. I have tried the below format, and the updated config is syntactically right. However, the application is breaking because a particular cookie is missing now post upgradation.
Please find the details below (attached ACL too for reference),
Old format:
acl hdr_set_cookie_vcap_myaccount res.hdr(Set-Cookie) -m reg -i JSESSIONID(.*)Path=/myaccount
rspirep ^(Set-Cookie:.*)_VCAP_ID_=(.*)\ Path=(/[a-z]*?)(.*) \1__VCAP_ID__=\2\ Path=/myaccount\4;\ Secure;\ HttpOnly if hdr_set_cookie_vcap_myaccount
rspirep ^(Set-Cookie:.*)JSESSIONID=(.*)\ Path=(/[a-z]*?)(.*) \1JSESSIONID=\2\ Path=\3\4;\ Secure;\ HttpOnly if hdr_set_cookie_vcap_myaccount
New Format:
acl hdr_set_cookie_vcap_myaccount res.hdr(Set-Cookie) -m reg -i JSESSIONID(.*)Path=/myaccount
http-response replace-header Set-Cookie ^(.*)_VCAP_ID_=(.*)\ Path=(/[a-z]*?)(.*) \1__VCAP_ID__=\2\ Path=/myaccount\4;\ Secure;\ HttpOnly if hdr_set_cookie_vcap_myaccount
http-response replace-header Set-Cookie ^(.*)JSESSIONID=(.*)\ Path=(/[a-z]*?)(.*) \1JSESSIONID=\2\ Path=\3\4;\ Secure;\ HttpOnly if hdr_set_cookie_vcap_myaccount
I would really appreciate the support, as I have tried several solutions and nothing works. Let me know if any further details are needed.
Thanks!