Haproxy backend configuration
-
Hello,
I would like to ask you about proxying request to backend. Situation:
I have one server with app which is listening on specific url: https://onesite.com
I have pfsense in front of it and I want to have onesite server accessible on pfsense1.com url
what I have is redirect to host, but what doesn't work is sending request with url header of my backend onesite.com
Now:
https://pfsense1.com/blablabla -> https://192.168.0.1/blablabla
what expected:
https://pfsense1.com/blablabla -> https://onesite.com/blablablaThank you!
-
@xttenza said in Haproxy backend configuration:
what expected:
https://pfsense1.com/blablabla -> https://onesite.com/blablablaThis is just an URL, which you can see in the address line of the browser. But this is not seen by the web server. The server can see the SNI and the host header at its best.
SNI should not be required behind a proxy, however. And the host header can be replaced by HAproxy.
-
@viragomann I know, I know, I’m not able to make it happen, I tried that by setting http header, but without success. I read about reqrep which should do this, but it is not supported anymore.
-
@xttenza
What's about 'http-request replace-header', in case it's the wrong? -
Okay, there was two issues, one was tcp mode and the second one was under SSL offloading checked: Add ACL for certificate CommonName. (host header matches the "CN" of the certificate)
so for somebody how will want to have the same:
Create frontend with SSL Offloading checked
type http/https offloading selected
default backend selected
Use "forwardfor" option checked
and all other settings uncheckedbackend part
server with encrypt ssl checked
health check method none
and in advanced settings
backend pass thru
http-request set-header Host onesite.com
option httpchk GET /
http-check send hdr Host onesite.com