How can I configure a middleware plugin in my dynamic config but add additional configuration on a per-service basis (i.e. using docker labels in my compose file)?
This all works fine:
Traefik Static Configuration:
experimental: localPlugins: example: moduleName: github.com/traefik/plugindemo
my-example: plugin: example: headers: EveryoneGetsThis: ValueForEveryone
I can define my middleware and add as much common configuration as a I need and then reference my customised middleware in my service. Great.
How do I then add more configuration as I would do if I had just used a middleware directly?
I’ve tried all sort of permutations similar to those that one would use for built-in middleware or custom plugins used directly but none work if I have configured my middleware in the dynamic file.
e.g. I've tried things like this:
- "traefik.http.routers.sample_two.middlewares=custom-example" - "firstname.lastname@example.org.JustForOneService=Test"
Obviously my example is simplistic and contrived for this discussion. In reality I have a custom plugin that needs lots of common configuration that will be used by all the services using it. We don’t want to repeat this configuration in every service, but do need to add some more in a few cases.