You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -200,8 +200,43 @@ information see the [Gateway API Conformance Page](https://gateway-api.sigs.k8s.
200
200
Backend TLS is not supported by AWS ALB Gateway. For more information on how AWS ALB communicates with targets using encryption,
201
201
please see the [AWS documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-routing-configuration).
The AWS Load Balancer Controller supports HTTPRoute RequestRedirect filters with both `ReplaceFullPath` and `ReplacePrefixMatch` path modification types.
206
+
207
+
**ReplacePrefixMatch Behavior:**
208
+
209
+
The behavior of `ReplacePrefixMatch` depends on whether other redirect components are modified:
210
+
211
+
1. **With scheme/port/hostname changes** - Path suffixes are preserved:
212
+
```yaml
213
+
filters:
214
+
- type: RequestRedirect
215
+
requestRedirect:
216
+
scheme: HTTPS # or port/hostname
217
+
path:
218
+
type: ReplacePrefixMatch
219
+
replacePrefixMatch: /new-prefix
220
+
```
221
+
- Request: `/old-prefix/path/to/resource`
222
+
- Redirects to: `/new-prefix/path/to/resource`✅ (suffix preserved)
223
+
224
+
2. **Without other component changes** - Only prefix is replaced, suffixes are NOT preserved:
225
+
```yaml
226
+
filters:
227
+
- type: RequestRedirect
228
+
requestRedirect:
229
+
path:
230
+
type: ReplacePrefixMatch
231
+
replacePrefixMatch: /new-prefix
232
+
```
233
+
- Request: `/old-prefix/path/to/resource`
234
+
- Redirects to: `/new-prefix`❌ (suffix lost)
235
+
236
+
**Recommendations:**
237
+
238
+
- For path-only redirects with exact paths, use `ReplaceFullPath`
239
+
- To preserve path suffixes with prefix replacement, also modify `scheme`, `port`, or `hostname`
0 commit comments