Skip to main content

Configure HTTP → HTTPS redirect

  1. Make sure you created a load balancer with an HTTPS rule that will accept requests to the HTTPS version of the website. You can view available load balancers in the Control panel: in the top menu, click Products → Cloud Servers → Load Balancers → Load Balancers tab.

  2. In the Control panel, in the top menu, click Products and select Cloud Servers.

  3. Go to Load Balancers → Load Balancers tab.

  4. Open the load balancer page.

  5. Click Create rule.

  6. Select the traffic reception protocol — HTTP. The default port 80, on which the load balancer will listen for traffic, will be selected automatically.

  7. Select the default target group — traffic that does not match the HTTP policies in the rule will be routed there. If there are no target groups available in the list, click New target group and create a target group with the HTTP destination protocol and port 80. If you want to drop traffic that does not match the HTTP policy, select No target group.

  8. Select the HTTP request headers to be forwarded to the servers.

  9. To create an HTTP policy in the rule, click Add new policy.

  10. Select the check condition: HOSTNAME — EQUAL TO.

  11. Enter a domain name, for example, example.com.

  12. Select the action Redirect to URL prefix.

  13. Enter the URL prefix — the part that will replace the protocol and domain name in the incoming request, for example, https://example.com.

  14. Optional: change the policy name or leave the default one.

  15. Click Add.

  16. Optional: open the Advanced rule settings section 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.
  17. Click Create.