Help needed with Network settings

The log shows the WOPI URL is:

https://nextcloud.example.com/index.php/apps/richdocuments/wopi/...

but the editor is loaded from:

office.example.com

When <wopi allow="false"> is enabled, Collabora Online Development Edition requires the storage host to match exactly. Since you are using two domains (Nextcloud + CODE), you need an alias group.

Restart coolwsd after changing it.

About /etc/hosts

Using /etc/hosts inside the container is fine and should not break WOPI. Collabora only checks the hostname string in the WOPI URL, not DNS resolution. Since your logs already show nextcloud.example.com, name resolution is working.