Nextcloud local and internet instance

take look at this post… and maybe the whole thread. the solution is called “split-brain DNS” and makes you access your instance using same domain name from inside and outside your network.