title: how to use X-Forwarded-Prefix in file backend
body: <p>I'm try to configure traefik with file backend to contact a grafana server in a LXC container.</p>
  
  <p>This is my configuration file: </p>
  
  <pre><code>[file]
  # rules
  [backends]
    [backends.backend2.servers.server1]
       url = "http://192.168.255.250:3000"
  [frontends]
    [frontends.frontend2]
      entryPoints = ["http"]
      backend = "backend2"
      passHostHeader = true
        [frontends.frontend2.routes]
        [frontends.frontend2.routes.route0]
          rule = "PathPrefixStrip: /grafana"
  </code></pre>
  
  <p>Grafana backend listen on /</p>
  
  <p>So, I can contact <a href="http://example.com/grafana" rel="nofollow noreferrer">http://example.com/grafana</a> but I have a redirection to <a href="http://example.com/login" rel="nofollow noreferrer">http://example.com/login</a> which does not work. But  <a href="http://example.com/grafana/login" rel="nofollow noreferrer">http://example.com/grafana/login</a> responding (without css, certainly because grafana seems to use relative url).</p>
  
  <p>According to the <a href="https://docs.traefik.io/basics/#frontends" rel="nofollow noreferrer">documentation</a> : </p>
  
  <blockquote>
    <p>Use a *Strip matcher if your backend listens on the root path (/) but should be routeable on a specific prefix. For instance, PathPrefixStrip: /products would match /products but also /products/shoes and /products/shirts.
    Since the path is stripped prior to forwarding, your backend is expected to listen on /.
    If your backend is serving assets (e.g., images or Javascript files), chances are it must return properly constructed relative URLs.
    Continuing on the example, the backend should return /products/shoes/image.png (and not /images.png which Traefik would likely not be able to associate with the same backend).
    The X-Forwarded-Prefix header (available since Traefik 1.3) can be queried to build such URLs dynamically.</p>
  </blockquote>
  
  <p>It seems that I have to use the X-Forwarded-Prefix header but I do not know how to use it (I did not see anything in the documentation). Maybe you can help me solve this problem ?</p>
  
  <p>Regards</p>
  
  <p>jmc</p>