Url encoding causing 404 not found

Dear All,
We have scenario where end user makes request
http://TRAEFIK_HOST/myexample/tenant1/docs and this needs to be converted to
http://ServiceEndpoint:PORT/docs?tenant=tenant1

we have configured traefik as below:

http:
  routers:
    docroute:
      rule: "PathPrefix(`/myexample/`)"
      service: docs
      middlewares: 
      - replacepathx@file
  services:
    docs:
      loadBalancer:
        servers:
        - url: "http://localhost:8011"
  middlewares:
    replacepathx:
      replacePathRegex:
        regex: "^/myexample/(.*)/docs/"
        replacement: "/docs?tenant=$1"

While forwarding the request, URL is getting encoding and it becomes
http://localhost:8011/docs%3Ftenant=tenant1

This is causing 404 not found exception.

How to avoid encoding of '?' while forwarding the request.

Please help.

thanks and regards,
Vijaya Bhaskar

Hi @pvb, were you able to fix this issue? I'm having a similar issue where url encoding is undesirable.