Google HTTP Load Balancing Enforces HTTPS

I have HTTP and HTTPS load balancing on Goole Cloud. Is it possible to configure it to force (redirect) all connections to HTTPS?

+5
source share
2 answers

Not on the load balance as of June 2015.

Alternatively, you can configure your web servers to return 301 for all HTTP request redirects to the HTTPS version.

For Apache (from https://wiki.apache.org/httpd/RedirectSSL ):

NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example.com Redirect permanent / https://www.example.com/ </VirtualHost> <VirtualHost _default_:443> ServerName www.example.com DocumentRoot /my/document/root SSLEngine On # .. etc . </VirtualHost> 

For nginx (from https://serverfault.com/questions/67316/in-nginx-how-can-i-rewrite-all-http-requests-to-https-while-maintaining-sub-dom ):

 server { listen [::]:80; return 301 https://$host$request_uri; } 
+4
source

Why worry about redirection? You can easily create a new global forwarding rule (SSL) and point it to your internal service.

For example, http://107.178.251.37/ points to my HTTP server, and I added another global forwarding rule to make it SSL: https://107.178.240.233/ .

-3
source

All Articles