From a4c33917cd98abfe940f48a1e015ac2dafb31fc8 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Tue, 29 Dec 2020 18:09:58 -0800 Subject: [PATCH] Adjustments to get nginx working --- configuration.nix | 2 +- inquisitor.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 717ae0d..36cfb60 100644 --- a/configuration.nix +++ b/configuration.nix @@ -26,7 +26,7 @@ hostId = "758371f0"; firewall = { enable = true; - allowedTCPPorts = [ 22 ]; + allowedTCPPorts = [ 22 80 443 ]; }; }; diff --git a/inquisitor.nix b/inquisitor.nix index 44e15cd..1847ce3 100644 --- a/inquisitor.nix +++ b/inquisitor.nix @@ -77,4 +77,23 @@ in after = [ "network.target" ]; enable = true; }; + + # Set up nginx to reverse proxy from the beatific url to the inq server + services.nginx.enable = true; + services.nginx.virtualHosts.inquisitorHost = { + listen = [ { addr = "10.7.3.99"; port = 80; } ]; + locations."/".extraConfig = '' + access_log /var/log/nginx/access.inquisitor.log; + proxy_buffering off; + proxy_pass http://localhost:24133/; + ''; + }; + + # Allow nginx through the firewall + networking.firewall = { + allowedTCPPorts = [ + 80 # http + 443 # https + ]; + }; }