Skip to content

[ingress-nginx] #12955 not fixed: Preserve query parameters when using app-root annotation #13315

@dfeinblatt

Description

@dfeinblatt

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

When using the ingress-nginx provider with the nginx.ingress.kubernetes.io/app-root annotation, query parameters for requests to the root are not preserved in the redirect. This is a re-report of the issue originally reported in #12955, as the resolution #12986 was incomplete. Specifically, the PR updated the regex to add a new capture group for the query parameters, but did not update the Replacement to include the captured query parameters.

For example, take an ingress with annotation nginx.ingress.kubernetes.io/app-root: /login

Expected behavior

  • https://site.example.com/ redirects to https://site.example.com/login/
  • https://site.example.com/?foo=bar redirects to https://site.example.com/login/?foo=bar

What did you see instead?

Observed behavior

  • https://site.example.com/ redirects to https://site.example.com/login (as expected)
  • https://site.example.com/?foo=bar redirects to https://site.example.com/login (query parameters are dropped)

What version of Traefik are you using?

3.7.3

What is your environment & configuration?

Using the kubernetesingressnginx

If applicable, please paste the log output in DEBUG level

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions