Bloc notes | NixOS & Nginx


Posted on April 8, 2017 comments [nixos, nginx]

Un exemple de config avec Letsencrypt.

{ 
  services.nginx = {
    enable = true; 
    virtualHosts = {
      "spof.px.io" = {
        forceSSL = true;
        enableACME = true;
        locations."/" = {
          root = "/var/www/spof/";
        };
        locations."~ ^/~(.+?)(/.*)?$" = {
          alias = "/home/$1/public_html$2";
          index = "index.html index.htm";
        };
      };
    };
  };
}

Plus d'info : https://nixos.org/nixos/options.html#services.nginx.virtualhosts