# Create Request & Response Rules

import DocButton from '~/components/webkit/DocButton.vue';

**Rules Engine** is an **Applications** capability that allows you to create no-code solutions that follow the business rules of your application.

With Azion **Applications** reverse-proxy architecture, the rules you create will be executed between either the **Request phase**, which contains data that a client sends to an origin server, or **Response phase**, which contains data from the origin that is sent to the client.

<DocButton href="/en/documentation/products/build/applications/rules-engine/" label="Learn more about Rules Engine" kind="secondary" size="medium" />

---

## Creating a request rule: Rewrite Request

Rules created in the **Request phase** will be executed before the request to the origin servers is completed. For instance, using the **Rewrite Request** behavior, you can create a rule to deliver content to a user from a specific URI without requiring that they use the exact path value from the origin in the request.

For the purposes of this guide, assume that your goal is to deliver the contents of the page `/content/page.html` when a client makes a request for `https://www.domain.com/page`. To create a rule that will rewrite this request:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Applications**.
2. Select the application for which you want to create the rule.
3. In the **Main Settings** tab, enable the **Application Accelerator** module.
4. Click the **Save** button.
5. Select the **Rules Engine** tab.
6. Click the **+ Rule** button.
7. Give your rule a name and, if necessary, a description.
8. Select **Request Phase**.
9. In the **Criteria** section, configure your criteria as follows:
    - If `${uri}` *is equal to* `/page`
    - This criteria will identify the URL of the request by the URI trailing slash `/`.
10. In the **Behaviors** section, add the behavior you want your application to execute. In this case, **Rewrite Request**.
11. The behavior selected takes an argument; to redirect the request to the page:
    - `${uri}content/page.html`
    - This argument concatenates the `${uri}` variable, whose value is `/`, to the page's path.
12. Click the **Save** button to save your rule.

Now, when a request is made to the URL `https://www.domain.com/page`, users should see the contents from the `/content/page.html` page without having to specify the entire address in their browser.

---

## Creating a response rule: Filter Response Header

Rules created in the **Response phase** will be executed before the response is delivered to the client. For example, you can create a rule that'll remove an HTTP header from the response using the **Filter Response Header** behavior.

The `Server` header stores information about the server that generated the response. By removing this header, clients won't receive information about the infrastructure of your application, enhancing your security by reducing the information available to potential attackers.

:::note
Exercise caution when removing any headers from your application and ensure that this action doesn't interfere in any applicable standards and guidelines.
:::

To filter the `Server` header from the response:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Applications**.
2. Select the application for which you want to create the rule.
3. In the **Main Settings** tab, enable the **Application Accelerator** module.
4. Click the **Save** button.
5. Select the **Rules Engine** tab.
6. Click the **+ Rule** button.
7. Give your rule a name and, if necessary, a description.
8. Select **Response Phase**.
9. In the **Criteria** section, configure your criteria as follows:
- If `${uri}` *starts with* `/`
- This criteria will execute the rule for the entire application.
10. In the **Behaviors** section, add the behaviors you want to be executed. In this case, **Filter Response Header**.
11. The behavior selected takes an argument, which should be `Server`.
- This argument will remove every instance of the `Server` header from all responses.
12. Click the **Save** button to save your rule.

Now, when a request is made to your application, the `Server` header will be removed from the response.