traefik mesh with node.js http-proxy

2/21/2022

I wrote a fairly simple microgateway with token introspection for development purposes. The gateway is deployed in a k3s cluster with traefik mesh installed. Request flow With the setup shown above, everything works as expected.
When I introduce traefik mesh which is called by the introspection gw instead of calling the respective service directly, I get an 404 error (assumingly by traefik). I ran curl from within the pod of the introspection gw and both URLs (against the service and against traefik mesh) work as expected. The logs indicate that the same url would be called by the introspection gw.
Source code of the gw can be found here: https://github.com/mxcd/introspection-microgateway/blob/master/index.js#L109 (this particular line shows the proxy function)

I assume it might be some kind of issue related with a header being set by the http-proxy module which conflicts with the internals of traefik when forwarding the request but I am a bit lost since I am fairly new to traefik mesh

-- mxcd
kubernetes
node-http-proxy
traefik

0 Answers