Jump to content

Caddy: Difference between revisions

71 bytes added ,  15 July 2023
m
Show caddy config as part of whole NixOS module
imported>Malteneuss
(Simplify curl check and add explanation for https)
imported>Malteneuss
m (Show caddy config as part of whole NixOS module)
Line 4: Line 4:
== Get started ==
== Get started ==


To try out Caddy add the following minimal example to your NixOS module:
To try out Caddy add the following minimal example to your [https://nixos.wiki/wiki/NixOS_modules NixOS module]:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.caddy = {
{
  enable = true;
  # ...
  virtualHosts."localhost".extraConfig = ''
  config.services.caddy = {
    respond "Hello, world!"
    enable = true;
  '';
    virtualHosts."localhost".extraConfig = ''
};   
      respond "Hello, world!"
    '';
  };
}  
</syntaxhighlight>
</syntaxhighlight>


Anonymous user