HTTP to HTTPS redirect in backend behind GCLB

6/17/2018

To my knowledge Google Cloud Load Balancer is not supporting HTTP to HTTPS redirect out of the box and it's a known issue: https://issuetracker.google.com/issues/35904733

Currently, I'm sending certain requests to GKE backend where I run Kubernetes apps and I have GCS-backed backends. I'm also using Apache in the default backend where I force HTTPS.

Problem with this approach is that, if any request match the criteria for GKE backend, I have no way to force HTTPS. I'm thinking to use Apache backend for all requests (?) and somehow proxy some of them to GKE backend. This way Apache backend becomes a bottleneck and I'm not sure if it's a good solution at all.

How would you approach this problem? Thanks in advance!

-- baqx0r
google-cloud-platform
google-kubernetes-engine
load-balancing

2 Answers

9/14/2018

Seems that the only way is to send HTTP traffic to custom backend (it can be apache/nginx) and force the HTTPS upgrade there.

I find this answer useful if you're using GKE backend with an Ingress.

How to force SSL for Kubernetes Ingress on GKE

-- baqx0r
Source: StackOverflow

7/27/2018

To force SSL traffic from Load Balancer to GKE backend (pod), you need to expose port 443 (or similar) on the pod and configure SSL there.

-- Md Zubayer
Source: StackOverflow