How to redirect http to https on GCP without another load balancer?

53 views
Skip to first unread message

RG

unread,
Jun 22, 2021, 4:17:37 AM6/22/21
to cloud-dns-discuss

I have several simple sites (mostly single bucket sites, and one LAMP site) and it seems that I need 2 load balancers per site. One for the https backend and certificate, and another to redirect http traffic to https.

GCP charges way too much for load balancers (about $18/month each) and this seems excessive for simple websites.

Is there any other way around this?

Does everyone redirect http to https? Or can I just not have it and expect everyone to go to the https site?

AWS has ALIAS records in Route53 that were perfect for this, but alas, GCP does not have ALIAS records in Cloud DNS.

I read somewhere that it's possible to use one load balancer for multiple backends but I have no idea how to implement that if true.

Marco Konec

unread,
Aug 18, 2021, 11:26:16 AM8/18/21
to cloud-dns-discuss

When you configure your external HTTP(S) load balancer, you should be able to choose what protocol you want to use (HTTP or HTTPS) and select your certificate [1]. In that sense, there shouldn’t be a need to set up a second load balancer in order to redirect HTTP traffic to HTTPS. If you feel you are still needing to redirect traffic, maybe you could provide me with more details on your infrastructure so I can better understand your particular needs.

[1]:

https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets

Reply all
Reply to author
Forward
0 new messages