fix: route Collabora WOPI endpoints through office host
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-10-22 12:04:21 -06:00
parent 6abbe796d1
commit 75d73e64a0
5 changed files with 27 additions and 0 deletions

View File

@ -54,6 +54,7 @@ locals {
office_server_name = local.office_server_name
office_backend_host = var.office_backend_host
office_backend_port = tostring(var.office_backend_port)
office_collabora_backend_port = tostring(var.office_collabora_backend_port)
})
default_vcl = templatefile("${path.module}/templates/default.vcl.tftpl", {
backend_host = var.backend_host

View File

@ -220,6 +220,25 @@ server {
client_max_body_size 2g;
# Collabora shares the office hostname; route its WOPI and WebSocket paths
# to the local Collabora backend while the root path remains Nextcloud.
location ~ ^/(browser|hosting|cool|lool)(/|$) {
proxy_pass http://${office_backend_host}:${office_collabora_backend_port};
proxy_http_version 1.1;
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
}
location / {
proxy_pass http://${office_backend_host}:${office_backend_port};
proxy_http_version 1.1;

View File

@ -163,6 +163,11 @@ variable "office_backend_port" {
default = 8090
}
variable "office_collabora_backend_port" {
type = number
default = 9980
}
# Matrix (isolated vhost + its own cert; does NOT touch shared current.crt)
variable "matrix_enabled" {
type = bool

View File

@ -56,6 +56,7 @@ services:
extra_params: >-
--o:ssl.enable=false
--o:ssl.termination=true
--o:server_name=${OFFICE_PUBLIC_HOST:-office.lab2025.duckdns.org}
--o:welcome.enable=false
--o:logging.level=warning
ports:

View File

@ -290,6 +290,7 @@ export_homelab_inventory_tf_vars() {
export_if_unset TF_VAR_office_server_name "${LAB_OFFICE_PUBLIC_HOST:-office.${LAB_DOMAIN:-lab2025.duckdns.org}}"
export_if_unset TF_VAR_office_backend_host "${LAB_OFFICE_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-${LAB_DEBIAN_LAN_IP:-}}}"
export_if_unset TF_VAR_office_backend_port "${LAB_OFFICE_HTTP_PORT:-8090}"
export_if_unset TF_VAR_office_collabora_backend_port "${LAB_OFFICE_COLLABORA_PORT:-9980}"
export_if_unset TF_VAR_jeannie_api_backend_host "${LAB_JEANNIE_API_BACKEND_HOST:-${LAB_DEBIAN_TAILSCALE_IP:-${LAB_DEBIAN_LAN_IP:-}}}"
export_if_unset TF_VAR_jeannie_api_backend_port "${LAB_JEANNIE_API_BACKEND_PORT:-8787}"
export_if_unset TF_VAR_gitops_repo_url "${LAB_GITOPS_REPO_URL:-}"