From 405b7ec95b8dd0c06caa0e4030760821aff370bc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 12 Jul 2020 14:02:50 +0100 Subject: feat(whitby): Enable Gerrit & cgit deployments Change-Id: Ic701552e130252cfff005938d9c4e98423a7a96a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1069 Reviewed-by: lukegb Tested-by: BuildkiteCI --- ops/nixos/www/code.tvl.fyi.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ops/nixos/www/code.tvl.fyi.nix (limited to 'ops/nixos/www/code.tvl.fyi.nix') diff --git a/ops/nixos/www/code.tvl.fyi.nix b/ops/nixos/www/code.tvl.fyi.nix new file mode 100644 index 0000000000..5ee33f39ca --- /dev/null +++ b/ops/nixos/www/code.tvl.fyi.nix @@ -0,0 +1,27 @@ +{ config, ... }: + +{ + imports = [ + ./base.nix + ]; + + config = { + services.nginx.virtualHosts.cgit = { + serverName = "code.tvl.fyi"; + enableACME = true; + forceSSL = 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/; + } + ''; + }; + }; +} -- cgit 1.4.1