Http-response set-header

Hi, I am experimenting with using the http-response command, specifically the following line:
http-response set-header X-Server %s

The configuration is as follows:

listen proxies-in
  bind 0.0.0.0:18509
  bind :::18509
  mode tcp
  default_backend proxies
  balance roundrobin

backend proxies
  mode HTTP
  http-response set-header X-Server %s
  server 127.0.0.1:15050 127.0.0.1:15050 check
  server 127.0.0.1:15051 127.0.0.1:15051 check

The goal here is that I would like to see the X-Server header added to the header and should indicate the server used to handle the request. I’ve seen configurations doing this but the X-Server is not added for my requests.

Client -> HaProxy Load balancing -> HTTPS Page --> HaProxy add header --> client.

Is this possible?

If this is not possible, How can I perform tasks given a specific HTTP Status code? For example run commands if i get status code 400 (lua or python)

Answering here for future reference; on haproxy 2.7 the following works:

backend highly-available-service
        mode http
        option forwardfor
        option redispatch
        http-response set-header X-Server %s
        server server_uk3 127.0.0.1:8080 check
        server server_uk1 86.162.112.12:443 check-ssl ssl backup weight 20

I can see the ‘X-Server’ header in the response valued ‘server_uk3’ or ‘server_uk1’ depending on the choice haproxy makes.