---
title: "Change the order of HTTP policies in a rule"
sidebar_label: "Change the order of HTTP policies in a rule"
sidebar_position: 4
description: "How to change the order of HTTP policies in a rule"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'

# Change the order of HTTP policies in a rule

The order of [HTTP policies](/cloud-servers/load-balancers/about-load-balancers.mdx#http-policies) depends on the policy action. First, policies to reject traffic (REJECT) are applied, then URL redirection (REDIRECT\_TO\_URL) and URL prefix (REDIRECT\_PREFIX) policies, and finally policies for redirection to a target group (REDIRECT\_TO\_POOL).

If a rule has multiple HTTP policies with the same action, they are applied according to the policy's position in the load balancer [rule](/cloud-servers/load-balancers/about-load-balancers.mdx#rules). You can change the policy position.

<Tabs queryString="change-policies-priority">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/), on the top menu, click **Products** and select **Cloud Servers**.

    2. Go to the **Load Balancers** section → the **Load Balancers** tab.

    3. Open the load balancer page.

    4. Open the rule card.

    5. In the **HTTP policies** block, drag and drop the policies. The policy above other policies with the same action will be applied first.

    6. Click **Confirm**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Change the position of an HTTP policy in a rule:

       ```bash
       openstack loadbalancer l7policy set --position <position> <policy>
       ```

       Specify:

       * `<position>` — the policy position in the rule. For example, a policy with position `1` will be applied first among policies with the same action;
       * `<policy>` — the ID or name of the HTTP policy. You can view the list with the command `openstack loadbalancer l7policy list`.
  </TabItem>
</Tabs>

<Formbricks />
