sky-uk / feed

Nginx based Kubernetes ingress controller for AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ingress URL is decoded when strip-path is set to true in ingress-config

manyamg opened this issue · comments

Background :
Talked to the core team (Supreeth), stripPath field in the ingress config when set to true can have impact on a url encoded characters. StripPath strips the path provided in the ingress config when set to true (Default value is true)
Hence we will set the stripPath to false.
We introduced application context path /app and admin context path /app/admin

I had a brief look through the code and all we are doing is configuring the nginx proxy_pass module. The presence or absence of a trailing / determines whether the url path is stripped or not and while doing so, the url is also decoded by this nginx module.

My first impression is that it's more of a change in the proxy_pass module. There was a ticket raised https://trac.nginx.org/nginx/ticket/727 which has been closed without action.

Will see if we can leverage some mechanism like url rewrite, through which we can achieve strip path but pass the encoded URL to the upstream. However, my initial thoughts are this would be a change with potential impact to all the teams.

So, not sure if it's worth the effort of any change here as teams can easily configure their applications in a way not to use strip path or not relying on the URL being encoded when it reaches them.

This is unfortunately a limitation of nginx.

This is expected behavior rather than an issue so we can update our docs to make it clear.
Replaced by https://github.com/sky-uk/core-platform/issues/8931.