We're int he process of migrating from nginx to HAProxy and one of my redirects needs to point a certain URL to an external server, but we also need to maintain that original URL in the address bar. I've tried numerous things with http-request and https-response, but I always end up showing the external site in the browser.
The below config is working in nginx for the wanted behavior. Can anyone help me out with my backend in HAProxy to mimic this result?
proxy_pass https://<site>/;
sub_filter_once off;
sub_filter '<external_site>' '<my_site>';
sub_filter_types text/html application/json application/xhtml+xml application/xml application/x-javascript;
proxy_set_header Host <external_site>;
proxy_set_header Accept "";
proxy_set_header Accept-Encoding "";
proxy_redirect <external_site> <my_site>;
proxy_intercept_errors on;
}```