-
Notifications
You must be signed in to change notification settings - Fork 136
Description
Describe the bug
When using the URLRewrite filter in NGINX Gateway Fabric version 1.1.0, even after configuring it according to the documentation and the commit here, an error occurs: "All rules are invalid: [spec.rules[0].filters[0].type: Unsupported value: "URLRewrite": supported values: "RequestRedirect", "RequestHeaderModifier", spec.rules[1].filters[0].type: Unsupported value: "URLRewrite": supported values: "RequestRedirect", "RequestHeaderModifier"]".
To Reproduce
Steps to reproduce the behavior:
Deploy NGINX Gateway Fabric version 1.1.0 to a Kubernetes Bare Metal cluster.
Configure an HTTPRoute with the URLRewrite filter as described in the provided example route.
Apply the configuration and observe the error.
Expected behavior
The URLRewrite filter should be supported and function as expected without throwing errors.
Your environment
Version of the NGINX Gateway Fabric: 1.1.0
Version of Kubernetes: v1.29.2
Kubernetes platform: Bare Metal
Details on how NGINX Gateway Fabric Pod is exposed: LoadBalancer
Logs of NGINX container:
Additional context
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: lynx-gateway
namespace: lynx
spec:
gatewayClassName: nginx
listeners:
- name: http
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Same
hostname: "*.lynx"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: http-lynx-api
namespace: lynx
labels:
app: lynx-api
spec:
parentRefs:
- name: lynx-gateway
sectionName: http
hostnames:
- api.lynx
rules:
- matches:
- path:
type: PathPrefix
value: /auth
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: lynx-authentication
namespace: lynx
kind: Service
port: 80
- matches:
- path:
type: PathPrefix
value: /catalogs
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: lynx-catalog-central
namespace: lynx
kind: Service
port: 80
---