Skip to content

Commit eeecc34

Browse files
Update how-to-path-header-query-string-routing-gateway-api.md
1 parent 0ef28d2 commit eeecc34

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/application-gateway/for-containers/how-to-path-header-query-string-routing-gateway-api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ author: greglin
66
ms.service: application-gateway
77
ms.subservice: appgw-for-containers
88
ms.topic: how-to
9-
ms.date: 07/28/2023
9+
ms.date: 07/31/2023
1010
ms.author: greglin
1111
---
1212

1313
# Path, header, and query string routing with Application Gateway for Containers - Gateway API (preview)
1414

15-
This document helps set up an example application that uses the following resources from Gateway API:
15+
This document helps set up an example application that uses resources from Gateway API to demonstrate traffic routing based on URL path, query string, and header:
1616
- [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) - creating a gateway with one https listener
1717
- [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) - creating an HTTP route that references a backend service
1818
- [HttpRouteMatch](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRouteMatch) - Using `matches` to route based on path, header, and query string.
@@ -154,12 +154,12 @@ status:
154154
kind: HTTPRoute
155155
```
156156
157-
Once the gateway has been created, create an HTTPRoute.
157+
Once the gateway has been created, create an HTTPRoute to define two different matches and a default service to route traffic to.
158158
159-
In this example, the following behavior is observed:
160-
1. Path based routing: Client request sent to http://frontend-fqdn/bar will be routed to backend-v2 service
161-
2. Query string + header + path routing: Client request sent to http://frontend-fqdn/some/thing?great=example with a header key/value part of "magic: foo" will be routed to backend-v2 service.
162-
3. If neither of the first two scenarios are satisfied, Application Gateway for Containers routes the request to backend-v1 service.
159+
The way the following rules read are as follows:
160+
1) If the path is /bar, traffic is routed to backend-v2 service on port 8080 OR
161+
2) If the request contains an HTTP header with the name magic and the value foo, the URL contains a query string defining the name great with a value of example, AND the path is /some/thing, the request will be sent to backend-v2 on port 8080.
162+
3) Else all other requests will be routed to backend-v1 service on port 8080.
163163
164164
```bash
165165
kubectl apply -f - <<EOF

0 commit comments

Comments
 (0)