0
votes

I am trying to create a load balancer on GCP that will route HTTP and HTTPS traffic to my single instance (I'm just testing things out so I have a single instance that serves http traffic).

My instance will be serving for many domains, and these domains are not owned by me but for my clients. I will simply manage the letsecrypt SSL certificates for these domains. They will point their domains to my service like a DNS record: service.example.com

Can I still use GCP load balancers for HTTPS traffic with the above considerations? I essentially need the load balancers to pass all SSL traffic to my instances.

I can't seem to figure out how to create a load balancer that will pass SSL traffic to my instances, is this possible?

1

1 Answers

0
votes

If your goal is to create a load balancer that passes thru HTTPS traffic (and HTTP) directly to a backend instance(s), use the TCP Load Balancer.

Step 1. Create a "regional" static IP address before creating the load balancer. Create the IP address in the same region as your instance.

Step 2: Create a TCP Load Balancer. I will skip the minor details that are obvious.

Backend configuration:

  • Select Single region only. This will allow you to bypass having instance groups.
  • Select existing instances -> Select your vm. Frontend configuration:
  • Protocol TCP. IP: select the static IP address that you created. Port: 80. Click Done.
  • Add another frontend. Protocol TCP. IP: same IP address. Port: 443. Click Done.

Once you create the load balancer, wait 5 or 10 minutes for everything to configure and startup.

Now your and HTTP and HTTPS traffic will be passed directly to your backend instance(s). Note that this configuration does not use autoscaling, managed instance groups, healthchecks, etc.

You will manage your SSL certificates on your backend instance(s) (your Compute Engine VMs). The load balancer just passes traffic thru with no SSL offload.