diff options
Diffstat (limited to 'Biz/Cloud/Web.nix')
-rw-r--r-- | Biz/Cloud/Web.nix | 82 |
1 files changed, 63 insertions, 19 deletions
diff --git a/Biz/Cloud/Web.nix b/Biz/Cloud/Web.nix index acd5c2f..56eeb2d 100644 --- a/Biz/Cloud/Web.nix +++ b/Biz/Cloud/Web.nix @@ -1,6 +1,7 @@ -{ ... }: +{ config, ... }: let + rootDomain = config.networking.domain; bensIp = "24.140.84.23"; in { @@ -11,31 +12,74 @@ in recommendedOptimisation = true; recommendedProxySettings = true; recommendedTlsSettings = true; + + group = "users"; + virtualHosts = { - "bsima.me".root = "/home/ben/public_html/"; - "www.bsima.me".root = "/home/ben/public_html/"; - "simatime.com".locations."/".root = "/srv/www/"; - "firefoxsync.simatime.com".locations."/".proxyPass = "http://localhost:5001"; - "hero.simatime.com".locations."/".proxyPass = "http://${bensIp}:3001"; - "tv.simatime.com".locations."/".proxyPass = "http://${bensIp}:8096"; # emby runs on port 8096 - "deluge.simatime.com".locations."/".proxyPass = "http://${bensIp}:8112"; - - "notebook.simatime.com".locations = { - "/" = { - proxyPass = "http://${bensIp}:3099"; - proxyWebsockets = true; - extraConfig = '' - proxy_buffering off; - proxy_read_timeout 86400; + ${rootDomain} = { + locations."/".root = "/srv/www/"; + # serve /~$USER paths + locations."~ ^/~(.+?)(/.*)?$" = { + alias = "/home/$1/public_html$2"; + index = "index.html index.htm"; + extraConfig = '' + autoindex on; ''; }; - "/(api/kernels/[^/]+/channels|terminals/websocket)/" = { - proxyPass = "http://${bensIp}:3099"; - proxyWebsockets = true; + forceSSL = true; + enableACME = true; + }; + + "bsima.me" = { + locations."/" = { + root = "/home/ben/public_html/"; + index = "index.html index.htm"; + extraConfig = '' + autoindex on; + ''; }; + serverAliases = [ "www.bsima.me" ]; + forceSSL = true; + useACMEHost = rootDomain; + }; + + "tv.${rootDomain}" = { + locations."/".proxyPass = "http://${bensIp}:8096"; # emby runs on port 8096 + forceSSL = true; + useACMEHost = rootDomain; }; + + "devalloc.io" = { + locations."/".proxyPass = "http://${bensIp}:8095"; + forceSSL = true; + useACMEHost = rootDomain; + }; + + # Jupyter is currently disabled on Biz.Dev + #"notebook.simatime.com".locations = { + # "/" = { + # proxyPass = "http://${bensIp}:3099"; + # proxyWebsockets = true; + # extraConfig = '' + # proxy_buffering off; + # proxy_read_timeout 86400; + # ''; + # }; + # "/(api/kernels/[^/]+/channels|terminals/websocket)/" = { + # proxyPass = "http://${bensIp}:3099"; + # proxyWebsockets = true; + # }; + #}; }; }; }; + + # This must contain all of the other domains we host + security.acme.certs.${rootDomain}.extraDomainNames = [ + "bsima.me" "www.bsima.me" "tv.${rootDomain}" + "devalloc.io" + "matrix.${rootDomain}" + "chat.${rootDomain}" + ];# } |