[SOLVED] Collabora CODE works but cannot save it to nextcloud

So i have a vm with collabora online, installed from packages.
It has a lets encrypt cert, and port 9980 is passed to it from the gateway.
So if i access all these, everything is ok:

Collabora Online Development Edition (CODE) - Admin console https://domain_example:9980/browser/dist/admin/admin.html – i get the admin dashboard

https://domain_example:9980 – i get the string “OK”

https://domain_example:9980/hosting/discovery – i get the wopi-discovery xml along with the correct urls (everything starts with https://domain_example:9980 )

So if i try to define this url in nextcloud, it just says “Setting up a new server” for some time 20-30 seconds, then i get the error “Could not establish connection to the Collabora Online server.”.

The only other thing i can say about it that i previosly had it behind haproxy (ssl termination), and i could configure it there, but had problem with the js files generated by collabora (they were imcomplete).

I have no idea why this is happening and what to check- Not loading on some clients - Installation & Configuration - Collabora Online

So my question would be about nextcloud. What logs i could check ? Or what to check ?
Im not sure what is happening. Why is hanging. It may have some url that it tries to access and its not ok.

So i just saw something.
If i call:
curl -v https://domain_example:9980/hosting/discovery

I get this:

  • Trying :9980…

And it hangs here.

If i do this from anoter vm, or from my pc, i get the xml.

One note: the collabora vm is behind the same gateway as the nextcloud vm.

So im not sure why this does not works, but i ended up defining its lan ip in /etc/hosts, and now it works as intended.