i have activated a HTTPS loadbalancer on GCP, with SSL certificate. On fronted i have specified HTTPS/443 as listening protocol and HTTP to comunication with backend.
https it working nicely, but loadbalancer also accept http/80 connection resulting in a 404 page.
Is there any way to forward http to https directly from loadbalancer?
thank you
Just create a second forwarding rule on the load balancer for port 80. Both will use the same backend service.
If you want to forward users from http to https then you can't do this from the load balancer. You will have to set this up in your backend service. You can find more details here: https://stackoverflow.com/questions/38201969/redirecting-http-to-https-in-google-cloud/38202272
Create a static global IP address first
An Ephemeral IP
ora static IP belong to any region
doesn't work for theGCP HTTP(S) load balancer
because it handles an IP to only a port. You can seta static global IP
to both ports 80/443 on your load balancer.I'm guessing a possible reason is that GCP load balancer doesn't belong to any region.