Configure HTTP → HTTPS redirect
Control panel
OpenStack CLI
-
Ensure that you have created a load balancer with an HTTPS rule that will accept requests to the HTTPS version of the site. Available load balancers can be viewed in the control panel: in the top menu, click Products → Cloud Servers → Load Balancers → Load Balancers tab.
-
In the Control panel, on the top menu, click Products and select Cloud Servers.
-
Go to the Load Balancers section → Load Balancers tab.
-
Open the load balancer page.
-
Click Create Rule.
-
Select the protocol for traffic reception — HTTP. The default port 80 will be automatically selected, on which the load balancer will listen for traffic.
-
Select a target group by default — traffic that does not fall under any HTTP policies in the rule will be directed there. If there are no available target groups in the list, click New target group and create a target group with the HTTP traffic destination protocol and port 80. If you want to drop traffic that does not fall under any HTTP policy, select No target group.
-
Select the HTTP request headers that need to be forwarded to servers.
-
To create an HTTP policy in the rule, click Add new policy.
-
Select the condition check: HOSTNAME — EQUAL TO.
-
Enter the domain name, for example
example.com. -
Select the action Redirect to URL prefix.
-
Enter the URL prefix — the part that will replace the protocol and domain name in the incoming request, for example
https://example.com. -
Optional: change the policy name or leave the default one.
-
Click Add.
-
Optional: open the Advanced rule settings block and specify the connection settings:
- for incoming requests to the load balancer — specify the connection timeout and the maximum number of connections;
- for requests from the load balancer to servers — specify the connection timeout, inactivity timeout, and TCP packet waiting timeout.
-
Click Create.