I have an HTTP backend server on Google Cloud behind a SSL Proxy Load Balancer.
If a client issues an HTTP request on port 80, the load balancer returns a 404. If possible, I'd like to redirect the port 80 request to port 443.
My first question is: can an SSL Proxy Load Balancer listen on both port 80 and port 443, but only terminate SSL on port 443?
If so, my second question is: can the backend somehow determine whether the load balancer terminated ssl or not?
If I use an HTTP(S) load balancer, all this is trivial and I can just look at the X-Forwarded-Proto
, but in this case, we're using a tcp load balancer, without HTTP headers, so I'm wondering if the same thing is possible somehow. The PROXY Protocol does not seem to contain this information.
Perhaps the load balancer can forward traffic from port 80 to port 8080 on the backend and traffic from port 443 to port 8443 on the backend so we know where it came from. Does the SSL Proxy Load Balancer support anything like this?
I can't use an HTTP(S) load balancer in my situation because I need to disallow HTTP/2.
I could also just use a TCP Proxy and handle SSL termination in the backend, but I want to use the Google Managed Certificates.