From 4e73e04688e9d659d8896ffc18aad981dd327ed6 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sun, 2 Jan 2022 20:57:46 +0000 Subject: [PATCH] Add nginx config for the catacomb auth server --- catacomb.nix | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/catacomb.nix b/catacomb.nix index 8fdb43a..407788e 100644 --- a/catacomb.nix +++ b/catacomb.nix @@ -10,10 +10,24 @@ extraConfig = '' access_log /var/log/nginx/access.catacomb.log; ''; - locations."/".extraConfig = '' - proxy_buffering off; - proxy_pass http://10.7.3.16:7473/; - ''; + locations = { + # Forwards to the index server + "/browse/".proxyPass = "http://10.7.3.16:7472/browse/"; + # Forwards to nginx via catacomb auth server + "/".extraConfig = '' + auth_request /auth; + proxy_buffering off; + proxy_pass http://10.7.3.16:7470/; + ''; + "= /auth".extraConfig = '' + internal; + proxy_buffering off; + proxy_pass_request_body off; + proxy_pass http://10.7.3.16:7471/; + proxy_set_header Content-Length ""; + proxy_set_header X-Original-URI $request_uri; + ''; + }; }; }