From 4feb306763d96866de16e336702459aaaec98a3b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 12 Feb 2020 01:09:03 +0000 Subject: feat(ops/nixos/camden): Add nginx vhost for cgit at git.camden --- ops/nixos/camden/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ops/nixos/camden') diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix index e3bf8003ce..8176df5c64 100644 --- a/ops/nixos/camden/default.nix +++ b/ops/nixos/camden/default.nix @@ -149,6 +149,9 @@ in pkgs.lib.fix(self: { user = "nginx"; group = "nginx"; webroot = "/var/lib/acme/acme-challenge"; + extraDomains = { + "git.camden.tazj.in" = null; + }; postRun = "systemctl reload nginx"; }; @@ -207,6 +210,24 @@ in pkgs.lib.fix(self: { } ''; }; + + virtualHosts.cgit = { + serverName = "git.camden.tazj.in"; + useACMEHost = "camden.tazj.in"; + addSSL = true; + + extraConfig = '' + # Static assets must always hit the root. + location ~ ^/(favicon\.ico|cgit\.(css|png))$ { + proxy_pass http://localhost:2448; + } + + # Everything else hits the depot directly. + location / { + proxy_pass http://localhost:2448/cgit.cgi/depot/; + } + ''; + }; }; system.stateVersion = "19.09"; -- cgit 1.4.1