Issue installing Collabora following official guide

To add some input on this, I am now also stuck with the

ClientRequestHandler::handleRequest: BadRequestException: Invalid URI or access denied.

The reasons advanced here in this topic for this issue seem to be that separating the nextcloud and CODE environments to different subdomains through apache reverse proxying blocks some information transmission (socket?) between the two. A local build of CODE seems to work fine.

(The following does not work, this is just for the sake of the discussion)
I actually don’t like the idea to expose the whole CODE only for this purpose when I could directly contact the docker on the local network. Furthermore using this self-signed certificate system.

This said, fully deploying on local causes issues: Problem with Collabora Online nginx setup - #17 by lukas
For my test purpose I have deployed everything on my local but the way docker handles the “-p 127.0.0.1:9980:9980” seems to mess up with the https communication with nextcloud/owncloud if you configure the CODE address at “https://localhost:9980

A solution I could think about is to use dsndock (https://github.com/tonistiigi/dnsdock)
This allows you to consider all your dockers as machines in your domain with names in your dns.
After succesfully doing this I changed all my “https://localhost:9980” to “https://code.docker:9980” (default configuration)
The apache reverse proxy way still gives the same error.
Now if I try “https://code.docker:9980” for CODE address in nextcloud itself I have the wonderful:

Collabora Online unknown error: cURL error 51: SSL: certificate subject name ‘localhost’ does not match target host name ‘code.docker’

The Self-signed certificate provided in the docker seems unsafe to me and is even blocking in my case.
Any idea how to work around this?