我在Google Cloud上有一个HTTP和HTTPS负载均衡器。是否可能将其设置为强制(重定向)所有连接到HTTPS?
我在Google Cloud上有一个HTTP和HTTPS负载均衡器。是否可能将其设置为强制(重定向)所有连接到HTTPS?
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>
server {
listen [::]:80;
return 301 https://$host$request_uri;
}