I use Traefik to balance the load between the various services registered in the Consul.
I use the consul-catalog configuration and redefine the external interface routing rule for one of the services, adding a tag when defining the service in the consul:
tags=['traefik.frontend.rule=PathPrefixStrip:/api,Host:api.service.consul']
I expect that /api, and will api.service.consulallow my service, however it is only /apisuccessful, however it api.service.consulreturns a 404 error.
In other words, only the first rule is considered. If I switch the tag:
tags=['traefik.frontend.rule=Host:api.service.consul,PathPrefixStrip:/api']
Then it api.servie.consulresolves, and /apireturns a 404 error.
I believe the docs suggest that this configuration is supported. Has anyone else had success in defining multiple rules using consul tags?
source
share