]> Git — Sourcephile - sourcephile-nix.git/blob - servers/mermet/nginx/sourcephile.fr/lemoutona5pattes.nix
backup: mermet: ~julm/log/
[sourcephile-nix.git] / servers / mermet / nginx / sourcephile.fr / lemoutona5pattes.nix
1 { pkgs, lib, config, ... }:
2 let inherit (config) networking;
3 inherit (config.services) nginx;
4 domain = "sourcephile.fr";
5 srv = "lemoutona5pattes";
6 in
7 {
8 services.nginx = {
9 virtualHosts."${srv}" = {
10 serverName = "${srv}.${domain}";
11 forceSSL = true;
12 useACMEHost = domain;
13 root = "/home/julm/www/${srv}";
14 extraConfig = ''
15 access_log ${nginx.logDir}/${domain}/${srv}/access.log json buffer=32k;
16 error_log ${nginx.logDir}/${domain}/${srv}/error.log warn;
17 '';
18 locations."/".extraConfig = ''
19 #autoindex on;
20 fancyindex on;
21 fancyindex_name_length 255;
22 fancyindex_exact_size off;
23 '';
24 };
25 };
26 systemd.services.nginx.preStart = lib.mkBefore ''
27 install -D -d -m 750 -o ${nginx.user} -g ${nginx.group} ${nginx.logDir}/${domain}/${srv}/
28 '';
29 }