Configure an HTTPS virtual server to accept HTTP traffic
-
Add HTTP and HTTPS virtual servers with the same IP address but different ports.
-
Add a responder action that redirects all traffic to the HTTPS virtual server.
-
Add a responder policy specifying the preceding action, and bind the policy to the HTTP virtual server.
-
Prepends an
<https://>to the incoming URL. -
Redirects the traffic to another HTTPS URL.
httpsRedirectUrl and redirectFromPort are added to the add lb vserver command.
-
redirectFromPort: All HTTP traffic received on this port is prefixed with
<https://>in the URL and redirected. Ensure that you also specify the redirect URL. If you do not specify the redirect URL, the traffic is redirected to the virtual server IP address. -
httpsRedirectUrl: All HTTP traffic received on the port specified in the -redirectFromPort parameter is redirected to this URL. For example, all HTTPS traffic received on http://www.example.com is redirected to https://www.sample.com.
httpsRedirectUrl and redirectFromPort parameters are supported in the add cs vserver command.
HttpsRedirectUrl parameter is not configured, you can expect the following behaviour:
-
For an LB virtual server, when the
autoscaleOptionin theset ns paramcommand is not set (i.e.value is zero), the HTTP traffic is redirected to the VIP of the SSL virtual server. When theautoscaleOptionis set to a value, the HTTP traffic is redirected to the host header value in the incoming HTTP request. -
For a CS virtual server, the HTTP traffic is redirected to the value of the host header in the incoming HTTP request, irrespective of the
autoscaleOptionin theset ns paramcommand.
Configure HTTP to HTTPS redirect on load balancing virtual servers by using the CLI
add lb vserver <name> <serviceType> -redirectFromPort <port | *> -httpsRedirectUrl <URL>
add lbvserver lbvip2 SSL 1.2.1.2 443 -redirectFromPort 80 -httpsRedirectUrl https://www.example.com
Configure HTTP to HTTPS redirect on load balancing virtual servers by using the GUI
-
Navigate to Traffic Management > Load Balancing > Virtual Servers.
-
Add a virtual server of type SSL and click OK.
-
Edit Basic Settings, click More, and add values for Redirect From Port and HTTPS Redirect URL.
Configure HTTP to HTTPS redirect on content switching virtual servers by using the CLI
add cs vserver <name> <serviceType> -redirectFromPort <port|*> [-httpsRedirectUrl <URL>]
add cs vserver csv1 SSL 1.2.4.5 443 -redirectFromPort 80 -httpsRedirectUrl https://www.example.com`
Configure HTTP to HTTPS redirect on content switching virtual servers by using the GUI
-
Navigate to Traffic Management > Content Switching > Virtual Servers.
-
Add a virtual server of type SSL and click OK.
-
Edit Basic Settings, click More, and add values for Redirect From Port and HTTPS Redirect URL.