2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx public-inbox;
9 virtualHosts."${srv}" = {
10 serverName = "${srv}.${domain}";
13 #root = "/home/julm/work/sourcephile/txt";
15 access_log ${nginx.logDir}/${domain}/${srv}/access.log json buffer=32k;
16 error_log ${nginx.logDir}/${domain}/${srv}/error.log warn;
18 locations."/".return = "302 /archives";
19 locations."= /archives".return = "302 /archives/";
20 locations."/archives".proxyPass = "http://unix:${builtins.head public-inbox.http.listenStreams}:/archives";
23 systemd.services.nginx.preStart = lib.mkBefore ''
24 install -D -d -m 750 -o ${nginx.user} -g ${nginx.group} ${nginx.logDir}/${domain}/${srv}/