From a7fe8a3532bf266157ae36bd5ee53b1033b93fa6 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 11 Apr 2022 09:38:00 -0500 Subject: [PATCH] Add catch-all vhosts config --- hosts/2maccabees/default.nix | 17 +++++++++-------- hosts/2maccabees/vhosts.nix | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 hosts/2maccabees/vhosts.nix diff --git a/hosts/2maccabees/default.nix b/hosts/2maccabees/default.nix index 1780298..dd9df0e 100644 --- a/hosts/2maccabees/default.nix +++ b/hosts/2maccabees/default.nix @@ -1,12 +1,13 @@ { config, pkgs, ... }: { - imports = [ - ./networking.nix - ./dnsmasq.nix - ./home-assistant.nix - ../../profiles/rpi4.nix - ../../profiles/home.nix - ]; - networking.hostName = "2maccabees"; + imports = [ + ./networking.nix + ./dnsmasq.nix + ./home-assistant.nix + ./vhosts.nix + ../../profiles/rpi4.nix + ../../profiles/home.nix + ]; + networking.hostName = "2maccabees"; } diff --git a/hosts/2maccabees/vhosts.nix b/hosts/2maccabees/vhosts.nix new file mode 100644 index 0000000..0f9902c --- /dev/null +++ b/hosts/2maccabees/vhosts.nix @@ -0,0 +1,21 @@ +# Virtual hosts that don't seem to have any better place to live should go in here. +# There are others that are specific to their own purposese scattered about in the +# configuration in places where they more naturally live. This is more of a catchall +# for ones that do not have a better place to live +{ ... }: + +{ + services.nginx = { + enable = true; + # A proxy front-end for Syncthing + virtualHosts."dns.thehellings.lan" = { + locations = { + "/sync" = { + proxyPass = "http://127.0.0.1:8384"; + proxyWebsockets = true; + }; + }; + serverAliases = [ "dns" ]; + }; + }; +}