HTTP Header Rewriting
The HTTP header rewriting feature allows users to add, replace, or remove headers in HTTP requests or responses that match specific URLs. Below are detailed explanations of each operation and their corresponding fields:
Adding Header Information
Field Name | Type | Required | Description |
---|---|---|---|
match | string | Yes | Used to match the URL |
name | string | Yes | The name of the header to add |
value | string | Yes | The value of the header to add |
type | string | Yes | Defines the type of message to modify (can be request or response) |
header_rewrites:
- add:
match: "http://www\\.egernapp\\.com/egern.html"
name: Hello
value: World
type: request
In this example, the system will add a header named "Hello" with a value of "World" to all request messages where the URL matches "http://www.egernapp\\.com/egern.html".
Replacing Header Information
Field Name | Type | Required | Description |
---|---|---|---|
match | string | Yes | Used to match the URL |
name | string | Yes | The name of the header to replace |
value | string | Yes | The new value of the header |
type | string | Yes | Defines the type of message to modify (can be request or response) |
header_rewrites:
- replace:
match: "http://www\\.egernapp\\.com/egern.html"
name: Hello
value: World
type: request
In this example, the system will look for a header named "Hello" in all request messages where the URL matches "http://www.egernapp\\.com/egern.html" and replace its value with "World".
Deleting Header Information
Field Name | Type | Required | Description |
---|---|---|---|
match | string | Yes | Used to match the URL |
name | string | Yes | The name of the header to delete |
type | string | Yes | Defines the type of message to modify (can be request or response) |
header_rewrites:
- delete:
match: "http://www\\.egernapp\\.com/egern.html"
name: Hello
type: request
In this example, the system will delete a header named "Hello" from all request messages where the URL matches "http://www.egernapp\\.com/egern.html".