From 337f5824f0d4b2f404faa4b6b55cf171ef3f79a6 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 10 Jan 2021 21:30:06 +0100 Subject: [PATCH] Special headers for workadventure map --- hosts/web-2/configuration.nix | 12 +----------- hosts/web-2/public.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 hosts/web-2/public.nix diff --git a/hosts/web-2/configuration.nix b/hosts/web-2/configuration.nix index ab3214a..496ba28 100644 --- a/hosts/web-2/configuration.nix +++ b/hosts/web-2/configuration.nix @@ -9,6 +9,7 @@ ./gitea.nix ./ip.nix ./meow.nix + ./public.nix ./radicale.nix ./znc.nix ]; @@ -34,17 +35,6 @@ recommendedOptimisation = true; recommendedProxySettings = true; recommendedTlsSettings = true; - - virtualHosts."web-2.net.clerie.de" = { - enableACME = true; - forceSSL = true; - locations."/" = { - return = "404"; - }; - locations."/public/" = { - alias = "/var/www/public/"; - }; - }; }; networking.firewall.allowedTCPPorts = [ 80 443 ]; diff --git a/hosts/web-2/public.nix b/hosts/web-2/public.nix new file mode 100644 index 0000000..d505df8 --- /dev/null +++ b/hosts/web-2/public.nix @@ -0,0 +1,22 @@ +{ ... }: + +{ + services.nginx = { + virtualHosts."web-2.net.clerie.de" = { + enableACME = true; + forceSSL = true; + locations."/" = { + return = "404"; + }; + locations."/public/" = { + alias = "/var/www/public/"; + }; + locations."/public/centopia/" = { + alias = "/var/www/public/centopia/"; + extraConfig = '' + add_header Access-Control-Allow-Origin *; + ''; + }; + }; + }; +}