I have a configuration with two backend servers I need to redirect 301 to each server with an internal URL on HTTP. It's hard to use SSL because I can't install SSL on the Report Server in that configuration. Also, I can't use the virtual domain and shared IP to redirect traffic because there is some internal issue with Report Viewer when viewing reports.
I just need to redirect traffic to the backend server, preferably with an internal URL, but the IP will also be ok.
At the moment I know how to do it to one specific host but not to the current server.
Configuration:
Active/Passive configuration for the backend.
HA-Proxy version 2.0.29-0ubuntu1
Ubuntu 20.04.5 LTS
Keepalived v2.0.19
frontend raporty
bind 192.168.0..108:80
bind 192.168.0.108:443 ssl crt /etc/ssl/certs/haproxy.pem
default_backend reportserver
option forwardfor
backend reportserver
mode http
balance roundrobin
option httpchk uri /reports
http-check expect status 401
http-response set-header X-Server %s
http-request redirect code 301 location http://sql02.domain.local%[capture.req.uri]
server sql01 192.168.0.11:80 check check fall 5
server sql02 192.168.0.111:80 check check fall 5
http-response set-header X-Server %s