NextCloud with Collabora Online and Nginx Reverse Proxy

Hi all, I’m having some trouble to get Collabora Online working behind Nginx reverse proxy

Here my configuration:

  • Slave UCS server with Nextcloud and Collabora Online installed from AppCenter (so, as container)
  • Reverse proxy based on Debian with nginx installed and configured
  • Fixed public IP address associated with DNS entry

Here the Nginx reverse proxy configuration (https://www.collaboraoffice.com/code/nginx-reverse-proxy/ - 2. SSL terminates at the proxy):

server {

listen 443 ssl;
ssl on;

include snippets/letsencrypt.conf;

server_name FQDN_OF_THE_SERVER;

location / {
   proxy_pass https://PRIVATE_IP_OF_UCS;
proxy_redirect https://PRIVATE_IP_OF_UCS/ https://$host/nextcloud/;
    proxy_set_header X-Forwarded-Host $host:$server_port;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

# static files
location ^~ /loleaflet {
    proxy_pass http://PRIVATE_IP_OF_UCS:9980;
    proxy_set_header Host $http_host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
    proxy_pass http://PRIVATE_IP_OF_UCS:9980;
    proxy_set_header Host $http_host;
}

# Capabilities
location ^~ /hosting/capabilities {
    proxy_pass http://PRIVATE_IP_OF_UCS:9980;
    proxy_set_header Host $http_host;
}

# main websocket
location ~ ^/lool/(.*)/ws$ {
    proxy_pass http://PRIVATE_IP_OF_UCS:9980;
    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 http://PRIVATE_IP_OF_UCS:9980;
    proxy_set_header Host $http_host;
}

# Admin Console websocket
location ^~ /lool/adminws {
    proxy_pass http://PRIVATE_IP_OF_UCS:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
}

}

Here the behaviour:

Any hints?

Thanks so much for your help

Hi guys,

The problem has been fixed; I’ve created another public FQDN specific for Collabora and then I’ve configured the nextcloud container instance to resolve ip of collabora as the ip of the nginx reverse proxy in my dmz. After that everything has been starting to work like a charm

To clarify better: nextcloud and collabora run in the same VM, based on UCS, as container whereas the reverse proxy run in a separated machine based on debian. Nextcloud container must to resolve the IP of the Collabora container as the IP of machine that runs reverse proxy, and not as the machine itself where collabora is running

Hoping this can be helpful also to someone else

1 Like