Traefik: Difference between revisions

Dander (talk | contribs)
m rewording
Dander (talk | contribs)
m edited for clarity
Line 60: Line 60:
You can set  <code>staticConfigFile</code> like this:<syntaxhighlight lang="nixos">
You can set  <code>staticConfigFile</code> like this:<syntaxhighlight lang="nixos">
services.traefik.staticConfigFile = ./static_config.toml;
services.traefik.staticConfigFile = ./static_config.toml;
</syntaxhighlight>But you need to be careful about how you set the <code>services.traefik.dynamicConfigFile</code> option, if you use a path like shown above, your file will end up in the [[Nix store]], so the path to your config file will change every time you update it, which means Traefik won't be able to reload with your changes automatically, which defeats the point of using the dynamic config file.
</syntaxhighlight>But you need to be careful about how you set the <code>services.traefik.dynamicConfigFile</code> option, if you use a path like shown above, your file will end up in the [[Nix store]], and it will change every time you update your configuration, which means Traefik won't be able to reload with your changes automatically, which defeats the point of using the dynamic config file.


A way to avoid this is to use <code>etc.environment</code>:<syntaxhighlight lang="nixos">
A way to avoid this is to use <code>etc.environment</code>:<syntaxhighlight lang="nixos">