From d4f0263d517090d0fe30f7081041dff3fd2cdc77 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 2 Mar 2024 17:52:40 +0100 Subject: Bump HelloHTML It now takes an alternative domain, which was added to it's services. --- hosts/ahmed/hellohtml.linus.onl/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'hosts/ahmed/hellohtml.linus.onl') diff --git a/hosts/ahmed/hellohtml.linus.onl/default.nix b/hosts/ahmed/hellohtml.linus.onl/default.nix index 584e030..4859ed3 100644 --- a/hosts/ahmed/hellohtml.linus.onl/default.nix +++ b/hosts/ahmed/hellohtml.linus.onl/default.nix @@ -1,21 +1,34 @@ # This module defines the HelloHTML web server. It extends the NGINX config # with a virtual server that proxies the local HelloHTML service. {...}: let + mainDomain = "hellohtml.linus.onl"; + altDomain = "hellohtml.ulovlighacker.download"; + useACME = true; in { config = { # Start service listening on socket /tmp/hellohtml.sock services.hellohtml = { enable = true; + inherit altDomain; }; - # Register domain name. - services.cloudflare-dyndns.domains = ["hellohtml.linus.onl"]; + # Register domain names. + services.cloudflare-dyndns.domains = [ + mainDomain + altDomain + ]; # Use NGINX as reverse proxy. - services.nginx.virtualHosts."hellohtml.linus.onl" = { + services.nginx.virtualHosts.${mainDomain}= { + # Set up secondary domain name to also point to this host. Only the + # client (browser) should treat these as separate. On the server, they + # are the same. + serverAliases = [altDomain]; + enableACME = useACME; forceSSL = useACME; + locations."/" = rec { proxyPass = "http://localhost:8538"; # Disable settings that might mess with the text/event-stream response of the /listen/:id endpoint. -- cgit v1.2.3