Using Collabora from an external server

I am using two servers, each with different domains. One of the servers is a rental server, so it does not allow for detailed settings. From now on, I will refer to the former as Server A and the latter as Server B.

Server A is running and installing NC20 and Collabora with nginx. Server B is LiteSpeed with ownCloud running and installed. I want to use server A’s Collabora with server B’s ownCloud.

When I try to use Collabora from ownCloud in my current state, it warns me that it is an “unauthenticated WOPI host” and I cannot use it.

How can I use Collabora on Server A from Server B?


Server A: Nextcloud 20.0.6, PHP 7.4, Nginx 1.16.1
Server B: ownCloud 10.0.6, PHP 7.3, LiteSpeed

When I write the Nginx reverse proxy as per the official instructions, the error is no longer displayed, but the contents of the file are not displayed.

server {
    listen       443 ssl;
    server_name  MY.COLLABORA.SERVER;

    ssl_certificate /path/to/ssl_certificate;
    ssl_certificate_key /path/to/ssl_certificate_key;

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

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

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

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

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