summaryrefslogtreecommitdiff
path: root/config/services/web/git/default.nix
blob: 566be62a183494c2c458dc96a15aa0cae2a3e02d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, pkgs, ... }:
{
  services.nginx = {
    additionalModules = [ pkgs.nginxModules.subsFilter ];
    virtualHosts.git = {
      serverName = "git.${config.networking.domain}";
      enableACME = true;
      forceSSL = true;
      locations."/" = {
        proxyPass = "http://100.64.0.6/git/"; # hephaistos.aristote.mesh
        extraConfig = ''
          proxy_redirect default;
          # fix internal hyperlinks
          proxy_set_header Accept-Encoding "";
          subs_filter "href='/git/" "href='/";
          subs_filter "action='/git/" "action='/";
          subs_filter "href='/([^/]*)/([^/]*)/'" "href=/$1/$2/tree/" r;
        '';
      };
    };
  };
}