Skip to main content
Create HTTP policy

Create HTTP policy

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

  1. In the dashboard, on the top menu, click Products and select Cloud Servers.

  2. Go to BalancersBalancers tab.

  3. Open the balancer page.

  4. Open the rule card.

  5. Click Add New Policy.

  6. Select the parameter by which to validate the request: HOSTNAME for the domain name or PATH to validate the path.

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

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

  9. Optional: To add another condition to the policy, click New Condition and customize it. If there are multiple conditions in the policy, the request must match each of them to fall under the policy.

  10. Specify where to redirect the matching request:

    • Direct to a target group — select a target group or create a new one with the HTTP protocol;
    • URL redirect — 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 URL requests. For example, if you enter https://example.com/new, then the request to https://example.com/api will be forwarded to https://example.com/new/api

    To not accept requests that match the policy, select Deny Traffic.

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

  12. Click Add.