Compare commits

..

3 Commits

Author SHA1 Message Date
Simon L. 9b981918b0 fix(apache): send X-Forwarded-Prefix for EuroOffice SDK assets (#8290) 2026-06-09 17:51:02 +02:00
James Manuel 4bbd561aba 🐛 fix(apache): remove redundant X-Forwarded-Host header
Caddy sets X-Forwarded-Host by default in reverse_proxy blocks.
The explicit header_up is unnecessary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
2026-06-09 16:19:41 +02:00
James Manuel aa56b603ab 🐛 fix(apache): send X-Forwarded-Prefix for EuroOffice SDK assets
EuroOffice nginx maps $http_x_forwarded_prefix to construct SDK asset
URLs (e.g. /eurooffice/sdkjs/...). Without this header the prefix is
empty and the browser requests /sdkjs/... which Caddy routes to
Nextcloud → 404.

Send X-Forwarded-Prefix as a separate header instead of appending the
path to X-Forwarded-Host (as the OnlyOffice block does), matching
EuroOffice nginx expectations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
2026-06-09 16:19:41 +02:00
2 changed files with 1 additions and 14 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ http://{$APACHE_HOST}.nextcloud-aio:23973, # For Collabora callback and WOPI req
route /eurooffice/* {
uri strip_prefix /eurooffice
reverse_proxy {$EUROOFFICE_HOST}:80 {
header_up X-Forwarded-Host {http.request.hostport}/eurooffice
header_up X-Forwarded-Prefix /eurooffice
}
}
-13
View File
@@ -903,24 +903,11 @@ if [ "$EUROOFFICE_ENABLED" = 'yes' ]; then
# Adjust the EuroOffice host if using internal pattern
if echo "$EUROOFFICE_HOST" | grep -q "nextcloud-.*-eurooffice"; then
# Set internal URLs for server-to-server calls via Docker network,
# bypassing the public domain which may not resolve inside containers.
# DocumentServerInternalUrl: NC -> EuroOffice (direct container port)
# StorageUrl: EuroOffice -> NC (via port 23973 which has a matching Caddy server-block)
APACHE_CONTAINER_HOST="${EUROOFFICE_HOST%-eurooffice}-apache"
php /var/www/html/occ config:app:set eurooffice DocumentServerInternalUrl --value="http://$EUROOFFICE_HOST:80/"
php /var/www/html/occ config:app:set eurooffice StorageUrl --value="http://$APACHE_CONTAINER_HOST.nextcloud-aio:23973/"
EUROOFFICE_HOST="$NC_DOMAIN/eurooffice"
export EUROOFFICE_HOST
fi
php /var/www/html/occ config:app:set eurooffice DocumentServerUrl --value="https://$EUROOFFICE_HOST"
# Register EuroOffice preview provider in the explicit allowlist.
# Use a high fixed index (50) to avoid colliding with AIO's seeded indices (1-7, 23).
if ! php /var/www/html/occ config:system:get enabledPreviewProviders | grep -q "Eurooffice"; then
php /var/www/html/occ config:system:set enabledPreviewProviders 50 --value="OCA\Eurooffice\Preview"
fi
fi
else
# Remove EuroOffice app if disabled and removal is requested