Add authorization header per backend

I want to add an autorization header per backend, it’s possible?
I already try this but is not working

backend default_ad_agent
        mode http
        http-request add-header Authorization "xxxx" if { srv_id 1 }
        http-request add-header Authorization "yyyy" if { srv_id 2 }
        server 192.168.60.32 192.168.60.32:8080 id 1 weight 1 maxconn 10000 check inter 60000 rise 2 fall 3
        server 192.168.60.31 192.168.60.31:8080 id 2  weight 1 maxconn 10000 check inter 60000 rise 2 fall 3

No one can help me on this?

Hello,

what doesn’t work in detail? Can you see your header in the backend-server? I did a short test and can see the header with wireshark.

Update: sorry, missunderstood your question a little bit. Seems, the request-header can’t be added after the backend-decision. It is possible, that these headers are added before the decision, which backend will be used, but not sure :confused:

best regards,
Markus