diff options
Diffstat (limited to '')
-rw-r--r-- | default.nix | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/default.nix b/default.nix index d739a4c..18f32e6 100644 --- a/default.nix +++ b/default.nix @@ -66,13 +66,16 @@ with lib; root = # need to do it this (long) way since a user may change this value outside of this module let ssl = config.services.nginx.virtualHosts.${cfg.frontend.domain}.enableSSL; - in (cfg.frontend.package.override { + in (cfg.frontend.package.override ({ baseurl = (if ssl then "https://" else "http://") + cfg.frontend.domain; + } // (if cfg.frontend.proxyBackend then { serverurl = (if ssl then "wss" else "ws") + "://${cfg.frontend.domain}/websocket"; - }).outPath; - locations."/websocket" = { - proxyPass = "http://localhost:9160"; - proxyWebsockets = true; + } else {} ))).outPath; + locations = mkIf cfg.frontend.proxyBackend { + "/websocket" = { + proxyPass = "http://localhost:9160"; + proxyWebsockets = true; + }; }; }; }; |