2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx;
8 systemd.services.nginx.serviceConfig = {
9 BindPaths = [ "/home/julm/work/sourcephile/txt:/www" ];
12 virtualHosts."${srv}" = {
13 serverName = "${srv}.${domain}";
14 serverAliases = [ domain ];
19 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
20 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
22 locations."/".extraConfig = ''
25 fancyindex_name_length 255;
26 fancyindex_exact_size off;
28 locations."/git".return = "302 https://git.${domain}/$request_uri";
29 locations."/versions".return = "302 https://git.${domain}/$request_uri";
30 locations."/codes_sources".return = "302 http://git.${domain}";
31 locations."/mails".return = "302 https://mails.${domain}/$request_uri";
32 locations."/listes".return = "302 https://mails.${domain}/$request_uri";
35 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];