Unable to add account in desktop client

Nextcloud version: 15.0.2.0

I have maybe unusual configuration of Nextcloud. It’s configured in local network to be reached by host.local address. And to be seen from outside, it is connected to external server by VPN. On this server nginx is proxying public subdomain to Nextcloud box. Everything works flawlessly - i can login to the box with browser.

I’m trying to add synchronization with desktop client - it always worked ok, but now, after clicking “Login” button i have following error (10.200.0.4 is VPN address of this box, local network is 192.168.x.x):

Ta witryna jest nieosiągalna
Strona https://10.200.0.4/nextcloud/index.php/login/flow/grant?stateToken=CPlm8kgrmcD5yOfHiwEZINr5VIJm1DcMZSB6zNdtBpjqwvC2p2uFeXh7ava1HKZh&clientIdentifier= jest nieosiągalna.
ERR_ADDRESS_UNREACHABLE

Server address in the first step is https://subdomain.public.domain.pl/nextcloud. Clent connects and provides page with “Login” button.

Accounts configured some time ago (with older Desktop client and older Nexctloud server) continue to work. How can i solve thi issue?

Looks like 'overwritehost' => 'subdomain.public.domain.pl', did the trick.