Skip to main content
Create HTTP policy
Last update:

Create HTTP policy

The number of HTTP policies in a rule and the number of conditions in an HTTP policy are unlimited.

  1. In control panel go to Cloud platformBalancers.

  2. Open the tab Balancers → balancer page.

  3. Open the rule card.

  4. Click Add a new policy.

  5. Select the parameter for which the query will be checked: HOSTNAME for the domain name or PATH to check the path.

  6. Select the type of match to the reference value:

    • EQUAL TO — is a match;
    • STARTS WITH — begins with;
    • ENDS WITH — ends in;
    • CONTAINS — contains;
    • REGEX — regular expression.
  7. Enter a control value to check. If you selected the condition in step 6 REGEX, enter a regular expression.

  8. Optional: to add another condition to the policy, press New condition and customize it. If there are multiple conditions in the policy, the request must match each condition to fall under the policy.

  9. Specify where to redirect the matching request:

    • Direct to the target group — select a target group or create a new with the HTTP protocol;
    • Redirect to URL — enter a target URL that will completely replace the request URL, including protocol, domain name, path, and request parameters;
    • Redirect to URL prefix — enter the part of the URL to replace the protocol and domain name in the request URL. For example, if you enter https://example.com/newthen the request for https://example.com/api will be forwarded to https://example.com/new/api

    To not accept requests that match the policy, select Reject traffic.

  10. Enter a policy name or leave the default one generated.

  11. Click Add.