2 { pkgs, lib, config, inputs, hostName, ... }:
4 inherit (config) networking;
5 inherit (config.services) nginx;
7 root = "/var/lib/nginx/${domain}";
10 systemd.services.nginx.serviceConfig = {
12 "/home/julm/work/sourcephile/txt:${root}/${srv}"
15 "nginx/${domain}/${srv}"
17 LogsDirectory = lib.mkForce [
18 "nginx/${domain}/${srv}"
22 virtualHosts."${srv}.${domain}" = {
23 serverAliases = [ domain ];
26 root = "${root}/${srv}";
28 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
29 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
31 locations."/".extraConfig = ''
34 fancyindex_name_length 255;
35 fancyindex_exact_size off;
37 locations."/git".return = "302 https://git.${domain}/$request_uri";
38 locations."/versions".return = "302 https://git.${domain}/$request_uri";
39 locations."/codes_sources".return = "302 https://git.code.${domain}";
40 locations."/mails".return = "302 https://mails.${domain}/$request_uri";
41 locations."/listes".return = "302 https://mails.${domain}/$request_uri";