Create an HTTP policy
There is no limit to the number of HTTP policies in a rule or the number of conditions in an HTTP policy.
Control panel
OpenStack CLI
-
In the control panel, in the top menu, click Products and select Cloud Servers.
-
Go to the Load Balancers section → Load Balancers tab.
-
Open the load balancer page.
-
Open the rule card.
-
Click Add new policy.
-
Select the parameter by which the request will be checked:
HOSTNAMEfor a domain name orPATHto check the path. -
Select the match type for the control value:
EQUAL TO— matches;STARTS WITH— starts with;ENDS WITH— ends with;CONTAINS— contains;REGEX— regular expression.
-
Enter the check value. If you selected the
REGEXcondition in step 7, enter a regular expression. -
Optional: to add another condition to the policy, click New condition and configure it. If there are multiple conditions in a policy, a request must match each of them to fall under the policy.
-
Specify where to redirect a matching request:
- Forward to target group — select a target group or create a new one with the HTTP protocol;
- Redirect to URL — enter the target URL that will completely replace the request URL, including the protocol, domain name, path, and query parameters;
- Redirect to URL prefix — enter the part of the URL to replace the protocol and domain name in request URLs with. For example, if you enter
https://example.com/new, a request tohttps://example.com/apiwill be redirected tohttps://example.com/new/api
To reject requests matching the policy, select Reject traffic.
-
Enter a name for the policy or leave the default one.
-
Click Add.