description: Learn how to configure an HTTP Route bound to an API Gateway on VMs.
---
# HTTP route configuration reference
This topic provides reference information for the gateway routes configuration entry. Refer to [Route Resource Configuration](/consul/docs/api-gateway/configuration/routes) for information about configuring API gateway routes in Kubernetes environments.
## Configuration model
The following list outlines field hierarchy, language-specific data types, and
requirements in an `http-route` configuration entry. Click on a property name
to view additional details, including default values.
- [`Kind`](#kind): string | must be `http-route`
- [`Name`](#name): string | no default
- [`Namespace`](#namespace): string | no default <EnterpriseAlert inline />
- [`Partition`](#partition): string | no default <EnterpriseAlert inline />
- [`Meta`](#meta): map | no default
- [`Hostnames`](#hostnames): list | no default
- [`Parents`](#parents): list | no default
- [`Kind`](#parents-kind): string | must be `api-gateway`
- [`Name`](#parents-name): string | no default
- [`Namespace`](#parents-namespace): string | no default <EnterpriseAlert inline />
- [`Partition`](#parents-partition): string | no default <EnterpriseAlert inline />
- [`SectionName`](#parents-sectionname): string | no default
- [`Rules`](#rules): list | no default
- [`Filters`](#rules-filters): map | no default
- [`Headers`](#rules-filters-headers): list | no default
- [`Add`](#rules-filters-headers-add): map | no default
- [`Remove`](#rules-filters-headers-remove): list | no default
- [`Set`](#rules-filters-headers-set): map | no default
- [`URLRewrite`](#rules-filters-urlrewrite): map | no default
- [`Path`](#rules-filters-urlrewrite-path): string | no default
- [`Matches`](#rules-matches): list | no default
- [`Headers`](#rules-matches-headers): list | no default
- [`Match`](#rules-matches-headers-match): string | no default
- [`Name`](#rules-matches-headers-name): string | no default
- [`Value`](#rules-matches-headers-value): string | no default
- [`Method`](#rules-matches-method): string | no default
- [`Path`](#rules-matches-path): map | no default
- [`Match`](#rules-matches-path-match): string | no default
- [`Value`](#rules-matches-path-value): string | no default
- [`Query`](#rules-matches-query): list | no default
- [`Match`](#rules-matches-query-match): string | no default
- [`Name`](#rules-matches-query-name): string | no default
- [`Value`](#rules-matches-query-value): string | no default
- [`Services`](#rules-services): list | no default
- [`Name`](#rules-services-name): string | no default
| `set` | Configure this field to rewrite the HTTP request header. It specifies the name of an HTTP header to overwrite and the new value to set. Any existing values associated with the header name are overwritten. You can specify the following configurations: <ul><li>`name`: Required string that specifies the name of the HTTP header to set.</li><li>`value`: Required string that specifies the value of the HTTP header to set.</li></ul> | List of maps |
| `add` | Configure this field to append the request header with a new value. It specifies the name of an HTTP header to append and the values to add. You can specify the following configurations: <ul><li>`name`: Required string that specifies the name of the HTTP header to append.</li><li>`value`: Required string that specifies the value of the HTTP header to add.</li></ul> | List of maps |
| `remove` | Configure this field to specify an array of header names to remove from the request header. | List of strings |
### `Rules[].Filters.URLRewrite`
Specifies rule for rewriting the URL of incoming requests when an incoming request matches the `Rules.Matches` configuration.
#### Values
- Default: none
- This field is a map that contains a `Path` field.
### Rules[].Filters.URLRewrite.Path
Specifies a path that determines how Consul API Gateway rewrites a URL path. Refer to [Reroute HTTP requests](/consul/docs/api-gateway/usage#reroute-http-requests) for additional information.
#### Values
The following table describes the parameters for `path`:
| `replacePrefixMatch` | Specifies a value that replaces the path prefix for incoming HTTP requests. The operation only affects the path prefix. The rest of the path is unchanged. | String |
| `type` | Specifies the type of replacement to use for the URL path. You can specify the following values: <ul><li>`ReplacePrefixMatch`: Replaces the matched prefix of the URL path (default). </li></ul> | String |
### `Rules[].Matches[]`
Specifies the matching criteria used in the routing table. When an incoming
request matches the given HTTPMatch configuration, traffic routes to
services specified in the [`Rules.Services`](#rules-services) field.
#### Values
- Default: none
- Data type: List containing maps. Each member of the list contains the following fields:
- `Headers`
- `Method`
- `Path`
- `Query`
### `Rules[].Matches[].Headers[]`
Specifies rules for matching incoming request headers. You can specify multiple rules in a list, as well as multiple lists of rules. If all rules in a single list are satisfied, then the route forwards the request to the appropriate service defined in the [`Rules.Services`](#rules-services) configuration. You can create multiple `Header[]` lists to create a range of matching criteria. When at least one list of matching rules are satisfied, the route forwards the request to the appropriate service defined in the [`Rules.Services`](#rules-services) configuration.
#### Values
- Default: none
- Data type: List containing maps with the following fields:
- `Match`
- `Name`
- `Value`
### `Rules.Matches.Headers.Match`
Specifies type of match for headers: `"exact"`, `"prefix"`, or `"regex"`.
#### Values
- Default: none
- Data type: string
### `Rules.Matches.Headers.Name`
Specifies the name of the header to match.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches.Headers.Value`
Specifies the value of the header to match.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches[].Method`
Specifies a list of strings that define matches based on HTTP request method.
#### Values
Specify one of the following string values:
- `HEAD`
- `POST`
- `PUT`
- `PATCH`
- `GET`
- `DELETE`
- `OPTIONS`
- `TRACE`
- `CONNECT`
### `Rules[].Matches[].Path`
Specifies the HTTP method to match.
#### Values
- Default: none
- Data type: map containing the following fields:
- `Match`
- `Value`
### `Rules[].Matches[].Path.Match`
Specifies type of match for the path: `"exact"`, `"prefix"`, or `"regex"`.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches[].Path.Value`
Specifies the value of the path to match.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches[].Query[]`
Specifies how a match is completed on a request’s query parameters.
#### Values
- Default: none
- Data type: List of map that contains the following fields:
- `Match`
- `Name`
- `Value`
### `Rules[].Matches[].Query[].Match`
Specifies type of match for query parameters: `"exact"`, `"prefix"`, or `"regex"`.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches[].Query[].Name`
Specifies the name of the query parameter to match.
#### Values
- Default: none
- Data type: string
### `Rules[].Matches[].Query[].Value`
Specifies the value of the query parameter to match.
#### Values
- Default: none
- Data type: string
### `Rules[].Services[]`
Specifies the service that the API gateway routes incoming requests to when the
requests match the `Rules.Matches` configuration.
#### Values
- Default: none
- This field contains a list of maps. Each member of the list contains the following fields:
- `Name`
- `Weight`
- `Filters`
- `Namespace` <EnterpriseAlert inline />
- `Partition` <EnterpriseAlert inline />
### `Rules[].Services[].Name`
Specifies the name of an HTTP-based service to route to.
| `set` | Configure this field to rewrite the HTTP request header. It specifies the name of an HTTP header to overwrite and the new value to set. Any existing values associated with the header name are overwritten. You can specify the following configurations: <ul><li>`name`: Required string that specifies the name of the HTTP header to set.</li><li>`value`: Required string that specifies the value of the HTTP header to set.</li></ul> | List of maps |
| `add` | Configure this field to append the request header with a new value. It specifies the name of an HTTP header to append and the values to add. You can specify the following configurations: <ul><li>`name`: Required string that specifies the name of the HTTP header to append.</li><li>`value`: Required string that specifies the value of the HTTP header to add.</li></ul> | List of maps |
| `remove` | Configure this field to specify an array of header names to remove from the request header. | List of strings |
### `Rules[].Services[].Filters.URLRewrite`
Specifies rule for rewriting the URL of incoming requests.
#### Values
- Default: none
- This field is a map that contains a `Path` field.