expose nextcloud and collabora on proxy

This commit is contained in:
William 2025-10-17 11:47:04 -03:00
parent d0793fb125
commit f9874296ae

View file

@ -2,9 +2,15 @@
lib, lib,
config, config,
pkgs, pkgs,
inputs,
... ...
}: }:
let
utils = import ../../utils.nix { inherit inputs lib; };
inherit (utils) mkNginxVHosts;
in
{ {
services = { services = {
nextcloud = { nextcloud = {
@ -62,17 +68,35 @@
collabora-online = { collabora-online = {
enable = true; enable = true;
port = 9980;
settings = { settings = {
ssl = { ssl = {
enable = false; enable = false;
termination = true; termination = true;
}; };
net = { net = {
listen = "unix"; listen = "loopback";
frame_ancestors = "cloud.baduhai.dev"; frame_ancestors = "cloud.baduhai.dev";
}; };
}; };
}; };
nginx.virtualHosts = mkNginxVHosts {
acmeHost = "baduhai.dev";
domains = {
"cloud.baduhai.dev" = { };
"office.baduhai.dev".locations = {
"/".proxyPass = "http://127.0.0.1:${toString config.services.collabora-online.port}";
"~ ^/cool/(.*)/ws$".proxyPass = "http://127.0.0.1:${toString config.services.collabora-online.port}";
"~ ^/cool/(.*)/ws$".extraConfig = ''
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 36000s;
'';
};
};
};
}; };
age.secrets = { age.secrets = {