<p>I have a kube service that has a <code>/customers</code> resource that will return all customers. It can also return a specific customer at <code>/customers/1</code>. I've configured Traefik ingress as follows:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    traefik.frontend.rule.type: PathPrefix
  name: customerd
  namespace: video
spec:
  rules:
  - host: custd.kube
    http:
      paths:
      - backend:
          serviceName: customerd
          servicePort: http
        path: /customers
      - backend:
          serviceName: customerd
          servicePort: http
        path: /custdhealth
      - backend:
          serviceName: customerd
          servicePort: http
        path: /metrics
      - backend:
          serviceName: customerd
          servicePort: http
        path: /sleeper
</code></pre>

<p>Note that the following annotation is present: <code>traefik.frontend.rule.type: PathPrefix</code>. From the Traefik documentation:</p>

<blockquote>
  <p>Use a * Prefix * matcher if your backend listens on a particular base
  path but also serves requests on sub-paths. For instance, PathPrefix:
  /products would match /products but also /products/shoes and
  /products/shirts. Since the path is forwarded as-is, your backend is
  expected to listen on /products.</p>
</blockquote>

<p>The issue is that when I submit a request to <code>/customers/1</code> the response is a 404. I've confirmed that the request doesn't reach the service. If I change <code>PathPrefix</code> to <code>PathPrefixStrip</code> requests to <code>/customers</code> return a 404, as expected, since the service isn't listening on <code>/</code>. So it seems like I'm using the annotation correctly.</p>

<p>Any ideas what I'm doing wrong or further troubleshooting steps?</p>

Rich
<p>After more debugging I figured out the problem. It wasn’t with how I was using Traefik, it was a misunderstanding on my part about how Golang HTTP routing works. My route was coded as “/customers”. Turns out this route will never satisfy “/customers/{id}”. “/customers/“ however will route both “/customers” and “/customers/{id}”. So after a simple code change it all worked. </p>

<p>One factor complicating my debugging efforts was this behavior isn’t visible by inspecting the (non-Golang library) code or putting in debug log messages.</p>
