BackendGroups with namespace starts with digit doesn't proxy_passed to split_clients correctly #2606
Labels
bug
Something isn't working
community
refined
Requirements are refined and the issue is ready to be implemented.
size/medium
Estimated to be completed within a week
Milestone
Describe the bug
BackendGroups with namespace starts with digit doesn't proxy_passed to split_clients correctly.
For example, we have a namespace named
9c-network
and one of its routes has multiple backends.So ngf creates a split_clients named
$9c_network__some_route_name_rule0
and generates a lineproxy_pass http://$9c_network__some_route_name_rule0$request_uri;
However, it seems nginx processes the proxy_pass parameter as
$9
,c_network__...
, not$9c_network__...
.nginx responds with
502 Bad Gateway
and I found a log that saysno resolver defined to resolve c_network__some_route_name_rule0
.I suspect nginx think it's regex capture group if a split_clients starts with number.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
responds with 2xx~4xx, not 502 Bad Gateway
Your environment
"version":"1.4.0","commit":"8e653d6dfc671ca8f8d51f3eed29c25462f96e41"
Logs of NGINX container:
kubectl -n nginx-gateway logs -l app=nginx-gateway -c nginx
Details
NGINX Configuration:
kubectl -n nginx-gateway exec <gateway-pod> -c nginx -- nginx -T
Details
Additional context
I think it can be resolved by simply adding something before first %s
nginx-gateway-fabric/internal/mode/static/state/dataplane/types.go
Line 258 in 88269ac
https://github.com/nginx/nginx/blob/51857ce40400b48bc8900b9e3930cf7474fa0c41/src/http/ngx_http_script.c#L474-L480
The text was updated successfully, but these errors were encountered: