I'm using Google Cloud Load Balancer as the ingress controller to my GCP Kubernetes application. I want all requests to www.my_domain.com
to be redirected to my_domain_.com
.
Note: My GCLB is configured with an SSL certificate that is valid for both www.my_domain.com
and my_domain.com
.
I know this is possible using an http redirect in my external DNS management console, but an issue arises because of SSL termination.
I create an http redirect rule in my DNS management console to route all www.my_domain.com
traffic to https://my_domain.com
.
If a client browses to domain https://www.my_domain.com
, they will get a browser warning because the request will first go to server of my DNS management tool, which is not configured with a matching SSL cert.
I know that GCLB has limitations for redirecting http traffic to https, but that's not my main concern here. What I want to know is if it's possible in GCLB to configure a routing rule so that any request for www.my_domain.com
is redirected to my_domain.com
.
Thanks for any help!