Client Login Issues With Self Hosted Nextcloud

I am hosting my nextcloud via Yunohost on my vps and i have a domain which Yunohost/nextloud installed. I am not using nextloud proxies. When i tried to login to my nextcloud with android cleint by typing my domain (i tried with my bare ip and adding nextcloud subdomain) and i cannot login and i am getting “Malformed server configuration” error. What should i do. I disabled firewall i disabled fail2ban and tried but 0 response

Please check your Nextcloud server log. You can get instructions from the support template for doing so.

Also, what happens when you log in via the Web UI?

Have you already checked the Yunohost forums? Google found quite a few threads with people who had the same or similar issues:

https://forum.yunohost.org/t/cannot-connect-to-yunohost-nextcloud-with-nextcloud-client/16692

https://forum.yunohost.org/t/no-connection-with-android-app-malformed-server-configuration/27829

Looks like Nextcloud needs “visitor” permissions in Yunohost for clients to be able to connect. I’d guess that has something to do with their SSO solution.