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, on 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 to check the request against:
HOSTNAMEfor a domain name orPATHto check the path. -
Select the match type for the control value:
EQUAL TO— equals;STARTS WITH— starts with;ENDS WITH— ends with;CONTAINS— contains;REGEX— regular expression.
-
Enter the control value for verification. 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 a policy has multiple conditions, the request must match all of them for the policy to apply.
-
Specify where to redirect a matching request:
- Redirect 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 request parameters;
- Redirect to URL prefix — enter the part of the URL that should replace the protocol and domain name in the request URL. For example, if you enter
https://example.com/new, a request tohttps://example.com/apiwill be redirected tohttps://example.com/new/api
To not accept requests that match the policy, select Reject traffic.
-
Enter a name for the policy or leave the default one.
-
Click Add.