URL extension on a Traefik ingress controller to a Kubernetes pod

Hi, I’m having an issue where I am using StripPrefix middleware along with an Ingress Route definition to decide which Ignition gateway I access externally.
I can access http://npdtadkbaesch01d/foo/StatusPing correctly (where foo decides what service I’m to be redirected to but if I access home page http://npdtadkbaesch01d/foo/ then the response from Ignition redirects to /Start and traefik reports a 404 error.

I have also seen the same thing on a non container setup with nginx acting as a load balancer to 2 ignition gatways. If I use a custom port for frontend access, then /Start is returned. If I use port 80 then all works ok.
Below are my middleware & ingressRoute definition

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ignition-ingressRoute
  namespace: default
spec:
  entryPoints:
    - web
  routes:
    #- match: Host(`company.org`) && PathPrefix(`/admin`)
    - match: PathPrefix(`/foo`)
      kind: Rule
      services:
        - name: ignition-foo
          port: 8088
      middlewares:
        - name: stripprefix

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: stripprefix
spec:
  stripPrefix:
    prefixes:
      - /foo

See this thread:

What we really need to make this work is some additional reverse proxy awareness at the Gateway level, where we can redirect based on a configured prefix.

Thanks for the quick response, Kevin. So there is no way to make this work currently?

Not that I’m aware of…

1 Like