HAproxy: right way to redirect old domain?
We run a webserver behind HAproxy on pfsense, with wordpress in it (docker containers, btw).
Now we have other URLs/domains (= customer bought another company) which should be silently forwarded to our main domain. I set up a CNAME record ... and wonder how to solve that:
wordpress doesn't know about the old domain names, so the redirect should happen before somehow.
I played with some ACLs etc but so far didn't succeed. Does anyone have a nice pointer for me?
kiokoman last edited by
Two different domain should be forwarded to the same website ? rewrite condition for apache/nginx is not a solution?
@kiokoman I think, no: there has to be SSL/TLS at the front, so I need a LE-cert and a frontend for that, right? Otherwise the cert for the new domain wouldn't match the URL of the old domain.
I look for the right "layer" on which to solve that in an elegant and correct way.
kiokoman last edited by kiokoman
if it's only for letsencrypt you can add all the domains you want inside the same cert.
expand the cert with the new domain, the flag for certbot is -d DOMAINS "Comma-separated list of domains to obtain a certificate for"
in any case maybe someone else can give you a better solution.
@kiokoman customer doesn't want such a multi-domain cert ... ;-)
So I want a second HA-frontend with the matching cert for the old domain (I have that already) .. and this one should redirect. I think of some HAproxy-rule or a lua-file or so.