Redirect from one domain to another
-
Hi,
so I have HAProxy set up with the following:
- three domains
- http2https redirect
- shared frontend for various backends
- SSL termination with certificated based on SNI recognition
When someone looks for http://service1.example.com they are redirected to https://service1.example.com. The same goes for service2 etc. The backends are also available at service1.anotherexample.com, service2.anotherexample.com, etc. Internally, the backends are contacted via http.
Now I want to add a setting to redirect one additional domain to one of the existing domains so that when someone wants to connect to service1.another-example.com they are redirected to service1.anotherexample.com etc.
So it is not sufficient to redirect to "anotherexample.com". I have to keep the "service1" or "service2" part in the redirection. And if there is a path like "/something" at the end, I need to keep that, too.
What is the best way of doing this?
Many thanks.