Traefik: Difference between revisions

Dander (talk | contribs)
m no need to specify "Nix (the language)", no ambiguity
m moved a closing bracket in the config example, previous example does not build because "log" and "certificateResolvers" are listed under "entryPoints", rather than "staticConigOptions"
 
(One intermediate revision by one other user not shown)
Line 29: Line 29:
           http.tls.certResolver = "letsencrypt";
           http.tls.certResolver = "letsencrypt";
         };
         };
      };


        log = {
      log = {
          level = "INFO";
        level = "INFO";
          filePath = "${config.services.traefik.dataDir}/traefik.log";
        filePath = "${config.services.traefik.dataDir}/traefik.log";
          format = "json";
        format = "json";
        };
      };


        certificatesResolvers.letsencrypt.acme = {
      certificatesResolvers.letsencrypt.acme = {
          email = "postmaster@YOUR.DOMAIN";
        email = "postmaster@YOUR.DOMAIN";
          storage = "${config.services.traefik.dataDir}/acme.json";
        storage = "${config.services.traefik.dataDir}/acme.json";
          httpChallenge.entryPoint = "web";
        httpChallenge.entryPoint = "web";
        };
       };
       };


Line 55: Line 55:
</syntaxhighlight>
</syntaxhighlight>


==== Using files ====
==== Using non-Nix configuration files ====
If you are migrating from a Non-NixOS system, you might be interested in the <code>staticConfigFile</code> and <code>dynamicConfigFile</code> options.
If you are migrating from a Non-NixOS system, you might be interested in the <code>staticConfigFile</code> and <code>dynamicConfigFile</code> options.