Traefik: Difference between revisions

Dander (talk | contribs)
first draft, will revisit tomorrow
 
Dander (talk | contribs)
m rewording
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>dynamicConfigFile</code>, if you pass a path, your "dynamic" config file will point to a path in the Nix store, which would change on every update to the file, so you would need to reload Traefik for the changes to take effect, 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]], 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.


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">