Nextcloud trying to access built-in CODE server using container IP after upgrade

A few days ago I updated apps on my nextcloud instance, including the CODE server and integration. After that I could no longer open documents in, receiving the “Document loading failed” error. This is because nextcloud is now trying to use the internal container IP address instead of the host name. ie instead of https://mynextcloud…

I upgraded my nextcloud to the latest version. This didn’t solve the problem.

I didn’t make any changes to config.php and it was working a few days ago with overwrite.cli.url and overwritehost set. Where do I tell nextcloud to use the host name instead of the IP now?

Looking into this further I found the problem is caused by the app incorrectly configuring the following setting.
nc_db_a.oc_appconfig, richdocuments, public_wopi_url =
I extracted the value from a backup of the database done before the upgrade and set it manually. This didn’t solve the problem.
I started a docker image of CODE, updated the nginx conf to point to it, and everything worked immediately as soon as I switched to own server in Setting/Office.
Seems bugs have been introduced in both the built-in CODE server and the integration app.

Where is the nginx conf file that you changed to point to it?

Nginx runs on the bare metal host that runs the LXC and Docker containers. Nextcloud in LXC, CODE in Docker. Various CODE locations redirected to the Docker container (proxy_pass in the nginx site config file.