# Collabora Docker + Nextcloud + nginx docker, cannot open files, Collabora not sending HTTPS requests

**URL:** <https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125>\
**Category:** User Support\
**Created:** [May 20, 2022, 12:00am UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125 "2022-05-20T00:00:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![keenmouse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/keenmouse/32/447_2.png) [@keenmouse](https://forum.collaboraonline.com/u/keenmouse)\
**Post date:** [May 20, 2022, 12:00am UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/1 "2022-05-20T00:00:59Z")

</div>

Nextcloud shows Collabora connection is working. When I attempt to open a file in Nextcloud, Collabora logs errors like this:

```auto
wsd-00001-00600 2022-05-19 23:33:23.797926 +0000 [docbroker_010] ERR WOPI::CheckFileInfo failed for URI [https://nextcloud.example.com/index.php/apps/richdocuments/wopi/files/539_oc7tvxhh9k4b?access_token=T4Vd5Xqgf8s3lqwSrEfHhhutlAjXhLBf&access_token_ttl=0&permission=edit]: 0 . Headers: Body: []| wsd/Storage.cpp:675

```

Nginx does not log the request. If I curl the URI from within the Collabora container, I get a successful response and it is logged by nginx. I installed tcpdump in the Collabora container and confirmed that no HTTPS request is being sent.

Here is my docker-compose.override.yml, adapted from one I found [here](https://github.com/mailcow/mailcow-dockerized/issues/1760#issuecomment-424667172-permalink):

```auto
version: '2.1'
services:

    nginx-mailcow:
      networks:
        mailcow-network:
          ipv4_address: ${IPV4_NETWORK:-172.22.1}.100
          aliases:
            - phpfpm

    php-fpm-mailcow:
      extra_hosts:
        - "collabora.example.com:${IPV4_NETWORK:-172.22.1}.100"

    collabora:
      image: collabora/code
      container_name: collabora
      cap_add:
        - MKNOD
      environment:
        - dictionaries=en_US
        - extra_params=--o server_name=collabora.example.com --o ssl.enable=false --o ssl.termination=true
      networks:
        - mailcow-network
      extra_hosts:
        - "collabora.example.com:${IPV4_NETWORK:-172.22.1}.100"

```

Here is my nginx collabora.example.com.conf:

```auto
server {
    server_name collabora.example.com;

    ssl_certificate /etc/ssl/mail/cert.pem;
    ssl_certificate_key /etc/ssl/mail/key.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
    ssl_ecdh_curve X25519:X448:secp384r1:secp256k1;
    ssl_session_cache shared:SSL:50m;
    ssl_session_timeout 1d;
    ssl_session_tickets off;
    include /etc/nginx/conf.d/listen_plain.active;
    include /etc/nginx/conf.d/listen_ssl.active;
    server_tokens off;

    # This allows acme to be validated even with a different web root
    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        rewrite /.well-known/acme-challenge/(.*) /$1 break;
        root /web/.well-known/acme-challenge/;
    }

    if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }

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

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

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

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

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

```

---

<div class="post-metadata">

**Author:** ![keenmouse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/keenmouse/32/447_2.png) [@keenmouse](https://forum.collaboraonline.com/u/keenmouse)\
**Post date:** [May 21, 2022, 1:06am UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/2 "2022-05-21T01:06:30Z")

</div>

Realized that the hostname under `extra_hosts` in the `collabora:` section of `docker-compose.override.yml` is supposed to be the name of the Nextcloud server. Made some other adjustments because the php-fm section is unnecessary and there have been parameter name changes in Collabora 21.11.3.6

```auto
version: '2.1'
services:
    nginx-mailcow:
      networks:
        mailcow-network:
          ipv4_address: ${IPV4_NETWORK:-172.22.1}.100
    collabora:
      image: collabora/code
      container_name: collabora
      restart: always
      cap_add:
        - MKNOD
      environment:
        - dictionaries=en_US
        - username=[redacted]
        - password=[redacted]
        - aliasgroup1=https://nextcloud.example.com:443
        - extra_params=--o ssl.enable=false --o ssl.termination=true
      networks:
        - mailcow-network
      extra_hosts:
        - "nextcloud.example.com:${IPV4_NETWORK:-172.22.1}.100"

```

---

<div class="post-metadata">

**Author:** ![pedro.silva](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/pedro.silva/32/4_2.png) [@pedro.silva](https://forum.collaboraonline.com/u/pedro.silva)\
**Post date:** [May 23, 2022, 7:56am UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/3 "2022-05-23T07:56:52Z")

</div>

Welcome to the forum @keenmouse !

---

<div class="post-metadata">

**Author:** ![pedro.silva](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/pedro.silva/32/4_2.png) [@pedro.silva](https://forum.collaboraonline.com/u/pedro.silva)\
**Post date:** [May 23, 2022, 8:11am UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/4 "2022-05-23T08:11:52Z")

</div>

> [@keenmouse](#):
>
> Made some other adjustments because the php-fm section is unnecessary and there have been parameter name changes in Collabora 21.11.3.6

Does it now work? For more information on what are the current configurations including: [Configuration — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/installation/Configuration.html) and [CODE Docker image — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html)

---

<div class="post-metadata">

**Author:** ![keenmouse](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/keenmouse/32/447_2.png) [@keenmouse](https://forum.collaboraonline.com/u/keenmouse)\
**Post date:** [May 24, 2022, 6:32pm UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/5 "2022-05-24T18:32:22Z")

</div>

Yes, it does!

I was aware of the information in the links you provided; that’s where I started. The problem was getting it to work with the nginx container in mailcow. I’m pretty new to docker and docker-compose. I figured out that I had the wrong hostname in `extra_hosts` by running tcpdump in the collabora container and seeing that requests were going to the wrong IP address.

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [August 6, 2024, 2:14pm UTC](https://forum.collaboraonline.com/t/collabora-docker-nextcloud-nginx-docker-cannot-open-files-collabora-not-sending-https-requests/1125/6 "2024-08-06T14:14:43Z")

</div>

Closed on August 6, 2024, 2:14pm UTC


