diff --git a/server/nginx.nix b/server/nginx.nix index f723a63..2e551bf 100644 --- a/server/nginx.nix +++ b/server/nginx.nix @@ -6,6 +6,7 @@ let localhost = "127.0.0.1"; workstation = "192.168.1.64"; + collabora = "https://192.168.1.69:9980"; jellyfinPort = "8096"; gptPort = "7860"; nextcloudPort = 80; @@ -84,14 +85,14 @@ in { proxy port // { extraConfig = '' proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; - proxy_redirect off; - proxy_http_version 1.1; + proxy_redirect off; + proxy_http_version 1.1; ''; }; in { @@ -105,6 +106,33 @@ in { "vault.servidos.lat" = proxy vaultPort // { }; "qampqwn4wprhqny8h8zj.servidos.lat" = proxy secretFlamePort // { }; "xfwmrle6h6skqujbeizw.servidos.lat" = proxy qbitPort // { }; + "collabora.servidos.lat" = let + collaboraLocation = { + proxyPass = collabora; + extraConfig = '' + proxy_set_header Host $host; + ''; + }; + socketConfig = '' + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + proxy_read_timeout 36000s; + ''; + in base { + "^~ /browser" = collaboraLocation; + "^~ /hosting/discovery" = collaboraLocation; + "^~ /hosting/capabilities" = collaboraLocation; + "~ ^/(c|l)ool" = collaboraLocation; + "~ ^/cool/(.*)/ws$" = { + proxyPass = collabora; + extraConfig = socketConfig; + }; + "^~ /cool/adminws" = { + proxyPass = collabora; + extraConfig = socketConfig; + }; + }; "flix.servidos.lat" = { forceSSL = true; enableACME = true;