i have a unique requirement. We have to add a custom header for every backend server definition. This header will be analysed by downstream SSO agent and forward to appropriate IP address specified in header after authentication. This custom header contain iP address of router . SSO servers running from different servers. RP server simple send all incoming traffic to SSO server as shown below example.
SSO server doesn’t have too much intelligent except look into header send by RP server and forward to appropriate IP address after authentication was done.
url --> HAProxy RP server --> SSO server --> DC specific router --> application
RP server simply send traffic to SSO server for all traffic. SSO server does authentication and look for X-SSO hader. based on the IP address of this header, it will forward to that IP address.
I want to a rule something like below
acl is_sales4 hdr(host) -i sales-sso-mvdc.example.com
use_backend sales4_backend if is_sales4
cookie SERVERID insert indirect nocache
server server4 sso_server1:3000 check cookie sales-sso-dc1 http-request set-header X-SSO 10.42.137.158
server server5 sso_server2:3000 check cookie sales-sso-dc2 http-request set-header X-SSO 10.42.137.158
I knew it is not possible. i checked HAProxy documentation. server options doesn’t support per server http-request header setting. We can set up only at backend definition but not per server basis. I can’t use conditional http-request also since it doesn’t have any such unique criteria.
Thanks in advance.