Skip to content

Commit 3c1aa47

Browse files
Merge pull request #246758 from greg-lindsay/appgw-upd
minor edits
2 parents e9fc151 + c75f0c7 commit 3c1aa47

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ author: greglin
66
ms.service: application-gateway
77
ms.subservice: appgw-for-containers
88
ms.topic: how-to
9-
ms.date: 07/29/2023
9+
ms.date: 07/30/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 resources from Gateway API to demonstrate traffic routing based on URL path, query string, and header:
16-
- [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) - creating a gateway with one https listener
17-
- [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) - creating an HTTP route that references a backend service
18-
- [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.
15+
This document helps you set up an example application that uses the resources from Gateway API to demonstrate traffic routing based on URL path, query string, and header. Review the following gateway API resources for more information:
16+
- [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) - create a gateway with one HTTPS listener.
17+
- [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) - create an HTTP route that references a backend service.
18+
- [HTTPRouteMatch](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRouteMatch) - Use `matches` to route based on path, header, and query string.
1919

2020
## Prerequisites
2121

@@ -157,9 +157,9 @@ status:
157157
Once the gateway has been created, create an HTTPRoute to define two different matches and a default service to route traffic to.
158158
159159
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.
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 is sent to backend-v2 on port 8080.
162+
3) Otherwise, all other requests are routed to backend-v1 service on port 8080.
163163
164164
```bash
165165
kubectl apply -f - <<EOF
@@ -250,7 +250,7 @@ fqdn=$(kubectl get gateway gateway-01 -n test-infra -o jsonpath='{.status.addres
250250
By using the curl command, we can validate three different scenarios:
251251

252252
### Path based routing
253-
In this scenario, the client request sent to http://frontend-fqdn/bar will be routed to backend-v2 service.
253+
In this scenario, the client request sent to http://frontend-fqdn/bar is routed to backend-v2 service.
254254

255255
Run the following command:
256256
```bash
@@ -260,7 +260,7 @@ curl http://$fqdn/bar
260260
Notice the container serving the request is backend-v2.
261261

262262
### Query string + header + path routing
263-
In this scenario, the 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.
263+
In this scenario, the client request sent to http://frontend-fqdn/some/thing?great=example with a header key/value part of "magic: foo" is routed to backend-v2 service.
264264

265265
Run the following command:
266266
```bash
@@ -270,7 +270,7 @@ curl http://$fqdn/some/thing?great=example -H "magic: foo"
270270
Notice the container serving the request is backend-v2.
271271

272272
### Default route
273-
If neither of the first two scenarios are satisfied, Application Gateway for Containers will route all other requests to the backend-v1 service.
273+
If neither of the first two scenarios are satisfied, Application Gateway for Containers routes all other requests to the backend-v1 service.
274274

275275
Run the following command:
276276
```bash

0 commit comments

Comments
 (0)