I’ve got the same issue and i think i have the explanation but not the solution.
First, i will explain my case witch is, i think, the same as you.
My server is in my local network and is in demilitarized zone. So, for IPv4 connections, it is acceded by my public IPv4 address for outside the LAN and by it’s local IPv4 address from LAN.
Bur for IPv6 connections, it’s public address works no matter where you connect from.
I’ve got two DNS entry for it:
- an AAAA record with the public IPv6 address of the server a
- an A record for the public IPv4 address.
So my server can be acceded both by IPv4 and IPv6 from inside and from outside the LAN.
Now, let see what happens in the two cases you mentioned:
- When my phone uses 4G for internet connection (IPv4 only due to my provider):
- Both the android apps and Firefox uses IPv4 and the DNS gives the external address ; Every thing is working well in this scenarii ;
- When my phone is connected by wifi on my LAN (IPv4 and IPv6 connections):
- The android apps still use IPv4 and the DNS gives the external address witch is not reachable from the LAN ;
- Firefox also use IPv4 and get stuck (shame on them to prefer A records on AAA ones) ;
- Edge chromium uses IPv6 and work well.
My trick for PC’s is to use an hosts file under windows and linux to resolve local names and my server global name with IPv6 global address only.
For Android, there is no solution until the Nextcloud app will prefer use IPv6…