<p>I have the following kubernetes manifest</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik-external
    traefik.ingress.kubernetes.io/router.entrypoints: websecure, web
    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
  name: ingressname
  namespace: thenamespace
spec:
  rules:
  - host: my.host
    http:
      paths:
      - backend:
          serviceName: theservice
          servicePort: 8080
        path: /api
</code></pre>
<p>Havin an service, <code>theservice</code>, that listens to <code>/</code> I would expect the url <code>my.host/api/something/anotherthing</code> match to <code>/something/anotherthing</code> in <code>theservice</code>. That doesn't happen for me though, I get a 404 back.</p>
<p>Any ideas what might be wrong?</p>

Tomas Jansson
<p>During the transition from v1 to v2, a number of internal pieces and components of Traefik were rewritten and reorganized. As such, the combination of core notions such as frontends and backends has been replaced with the combination of <a href="https://doc.traefik.io/traefik/v2.0/routing/routers/" rel="nofollow noreferrer">routers</a>, <a href="https://doc.traefik.io/traefik/v2.0/routing/services/" rel="nofollow noreferrer">services</a>, and <a href="https://doc.traefik.io/traefik/v2.0/middlewares/overview/" rel="nofollow noreferrer">middlewares</a>.</p>
<p>With v2 transforming the URL path prefix of incoming requests is configured with <a href="https://doc.traefik.io/traefik/v2.0/middlewares/overview/" rel="nofollow noreferrer">middlewares</a> object, after the routing step with <a href="https://docs.traefik.io/v2.0/routing/routers/#rule" rel="nofollow noreferrer">router rule  <code>PathPrefix</code></a>.</p>
<p>With v1 it is defined at ingress level:</p>
<pre class="lang-yaml prettyprint-override"><code>    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
      name: traefik
      annotations:
        kubernetes.io/ingress.class: traefik
        traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
    spec:
      rules:
      - host: company.org
        http:
          paths:
          - path: /admin
            backend:
              serviceName: admin-svc
              servicePort: admin
</code></pre>
<p>With v2 you have define also middleware object alongside ingress-route:</p>
<pre class="lang-yaml prettyprint-override"><code>
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: http-redirect-ingressroute
  namespace: admin-web
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`company.org`) &amp;&amp; PathPrefix(`/admin`)
      kind: Rule
      services:
        - name: admin-svc
          port: admin
      middlewares:
        - name: admin-stripprefix
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: admin-stripprefix
spec:
  stripPrefix:
    prefixes:
      - /admin
</code></pre>
<p>More information can be found here:
<a href="https://doc.traefik.io/traefik/v2.0/migration/v1-to-v2/#frontends-and-backends-are-dead-long-live-routers-middlewares-and-services" rel="nofollow noreferrer">Frontends and Backends Are Dead...<br />
... Long Live Routers, Middlewares, and Services</a></p>
