]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/mermet/nginx/sourcephile.fr/whoami.nix
carotte: prepare switch install
[sourcephile-nix.git] / hosts / mermet / nginx / sourcephile.fr / whoami.nix
1 { domain, ... }:
2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx;
5 srv = "whoami";
6 in
7 {
8 services.nginx = {
9 virtualHosts."${srv}.${domain}" = {
10 forceSSL = true;
11 useACMEHost = domain;
12 root = "/var/empty";
13 extraConfig = ''
14 access_log off;
15 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
16 keepalive_requests 0;
17 default_type text/plain;
18 '';
19 locations."/addr".return = "200 $remote_addr\\n";
20 };
21 };
22 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];
23 }