stripPrefix not working on 1.7 Traefik

Hello Team Traefik
I try to configure my traefik internal load balancer.

enabled: true
imageTag: v1.7.20-alpine

annotations: Internal '{"default": "tools-backend-config"}'

I have a url
my ingress gcloud LB --> traefik ingress --> grafana-svc-->grafana-pods.

OK it's seems to work fine when i use the url*

Now i need to add more /backend to this URL instead of having 1 certificat by ingress
i would like to use one certificat for every service
URL: /project1 /bar

apiVersion: v1
kind: ConfigMap
  name: tools-traefik
  namespace: default
  traefik.toml: |
    # traefik.toml
    debug = true
    defaultEntryPoints = ["http","https"]
      address = ":80"
      compress = true
          regex = "^http://(.*)"
          replacement = "https://$1"
      address = ":443"
      compress = true
          CertFile = "/ssl/tls.crt"
          KeyFile = "/ssl/tls.key"

        service = "myService"
        middlewares = ["test"]
        rule = "Host(``)"

        prefixes = ["/builder", "/bar", "/grafana"]
        forceSlash = false

and this my ingress in gke:

apiVersion: extensions/v1beta1
kind: Ingress
  name: traefik-tools-project-ingress
  namespace: default
  annotations: traefik
    #traefik.frontend.rule: "PathPrefixStrip:/builder;PathPrefix:/builder"
    #traefik.http.middlewares.test.redirectregex.regex: "^*)"
    #traefik.http.middlewares.test.redirectregex.replacement: "$${1}"
    #traefik.http.middlewares.test-stripprefix.stripprefix.prefixes: "/bar,/builder"

#    traefik.frontend.rule.type: PathPrefixStrip
    - host:
          - path: /grafana
              serviceName: tools-grafana
              servicePort: 80
          - path: /bar
              serviceName: web
              servicePort: 8080
          - path: /builder
              serviceName: builder
              servicePort: 80

nothing work when i tape :// or grafana/

do you have an idea ?


These elements are Traefik v2 labels for Docker, they are not k8s annotations for Traefik v1.

Hi Idez Thks for your reply and your time .
I try the link below
regarding the doc in v1.7. In my case if i want to forward traffic to grafana on path / i need to implemented this

apiVersion: extensions/v1beta1
name: traefik-tools-project-ingress
namespace: default
annotations: traefik "PathPrefixStrip /grafana/"

but i faced an issue in the logs traefik did i do something wrong ?

{"level":"error","msg":"Failed to get rule for ingress default/traefik-tools-project-ingress: cannot use non-matcher rule: "PathPrefixStrip /grafana/"","time":"2020-02-15T15:15:32Z"}

i have also try "PathPrefixStrip" It work but my images cannot be loaded .

<img class="img-fluid link-image" src="/static/links-images/webapp.svg">

have to be .

<img class="img-fluid link-image" src="/grafana/static/links-images/webapp.svg">
in order to work ...

Do you have an idea ?

Hello For grafana i found the issue .

GF_SERVER_ROOT_URL: "%(protocol)s://%(domain)s:%(http_port)s/grafana"

but for the other apps i stuck with traefik . Traefik path based routing in kubernetes ingress not working as expected . I don't understand why i haved to change the Url backend for using reverse proxy . Traefik cannot be queried to build such URLs dynamically it's simplement inconceivable while nginx can do the staff with rewrite url .....