1

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.

pizzafilms
  • 3,829
  • 4
  • 24
  • 39
  • This is not an answer but not long ago, load balancers were a $10K - $20K+ investment that required admins to manage. If you are running a LAMP site, that probably means you are using Compute Engine. The easiest/cheapest is to enable/setup redirects in Apache. – John Hanley Jun 22 '21 at 00:41
  • Thanks, I'll give that a shot for the lamp site, but the ones that really bother me are the simple, one bucket website...and you end up paying for 2 load balancers. – pizzafilms Jun 22 '21 at 02:31
  • If you have that small of a site, what do you need a load balancer for? – John Hanley Jun 22 '21 at 02:41
  • Because a load balancer is required for https, and the second is required to redirect http to https. – pizzafilms Jun 22 '21 at 15:21
  • 1
    A load balancer is not required for HTTPS. The Apache web server supports HTTPS, HTTP -> HTTPS redirection, and more. – John Hanley Jun 22 '21 at 17:16
  • Is there a reason you can't user Firebase hosting? For static sites it can't be beaten (free) and has SSL and the ability redirect baked in. – toxaq Jan 16 '23 at 20:04

1 Answers1

2

Agree with what John has suggested. A load balancer is not really required for https and a webserver can serve the purpose.

To answer your other question regarding the possibility of using multiple backend for a load balancer please refer to this link. You can choose the right one for your environment.

This documentation provides additional information.

For external http(s) load balancing setup please refer to the link

For internal http(s) load balancing setup please refer to the link

For external network load balancer setup please refer to the link

For internal network load balancer setup please refer to the link

For ssl proxy load balancer setup please refer to the link

For tcp proxy load balancer setup please refer to the link

Kartik
  • 62
  • 5