Unable to add account in desktop client

Nextcloud version:

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 ( is VPN address of this box, local network is 192.168.x.x):

Ta witryna jest nieosiągalna
Strona jest nieosiągalna.

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.