diff --git a/templates/Nextcloud/0/docker-compose.yml b/templates/Nextcloud/0/docker-compose.yml index 1b15101..d89e067 100644 --- a/templates/Nextcloud/0/docker-compose.yml +++ b/templates/Nextcloud/0/docker-compose.yml @@ -42,6 +42,11 @@ services: io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} {{- end}} traefik.enable: false + links: + - mysql + {{- if eq .Values.REDIS "true"}} + - redis + {{- end}} restart: on-failure volumes_from: - nginx @@ -75,17 +80,13 @@ services: traefik.collabora.frontend.headers.STSPreload: true traefik.collabora.frontend.headers.STSSeconds: 15552000 traefik.collabora.frontend.rule: Host:collabora.${TRAEFIK_HOST} - traefik.collabora.port: "9980" + traefik.collabora.port: "81" ### End Collabora Segment links: {{- if eq .Values.COLLABORA "true"}} - collabora {{- end}} - - mysql - nextcloud - {{- if eq .Values.REDIS "true"}} - - redis - {{- end}} networks: - public-proxy {{- if .Values.WEB_PORT}} diff --git a/templates/Nextcloud/Resources/nginx.conf b/templates/Nextcloud/Resources/nginx.conf index 2c33275..c6717df 100644 --- a/templates/Nextcloud/Resources/nginx.conf +++ b/templates/Nextcloud/Resources/nginx.conf @@ -21,10 +21,13 @@ http { server nextcloud:9000; } + upstream collabora { + server collabora:9980 + } + server { listen 80; listen [::]:80; - server_name _; # Add headers to serve security related headers add_header X-Content-Type-Options nosniff; @@ -125,4 +128,45 @@ http { access_log off; } } + + server { + listen 81; + listen [::]:81; + + # static files + location ^~ /loleaflet { + proxy_pass collabora; + proxy_set_header Host $http_host; + } + + # WOPI discovery URL + location ^~ /hosting/discovery { + proxy_pass collabora; + proxy_set_header Host $http_host; + } + + # main websocket + location ~ ^/lool/(.*)/ws$ { + proxy_pass collabora; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + + # download, presentation and image upload + location ~ ^/lool { + proxy_pass collabora; + proxy_set_header Host $http_host; + } + + # Admin Console websocket + location ^~ /lool/adminws { + proxy_pass collabora; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + } } \ No newline at end of file