Nextcloud local and internet instance

Hi guys,
i have a question about using Nextcloud instance on my lan and permit to be expose to the internet:
i’m installing a Nextcloud instance on my local network (ip 10.10.50.10 and hostname nextcloud.condizio.local). All in my network works but i have a question about internet.
Desktop client and web dashboard is set to reach nextcloud from https://nexcloud.condizio.local but all shared link etc has this hostname as domain (e.g https://nextcloud.condizio.local/file/dsanv21) and don’t work outside lan.
what i need to do is expose nextcloud on the internet to permit call and file sharing with people outside my lan network.
if i add a DNS A record in my Aruba domain and point to nextcloud (external ip → nextcloud.condizio.com) it works outside lan and all reference to nextcloud instance passthrough internet (with new DNS A record); this is a problem because file size managed are bigger than 1 gb and i would know if there is a way to use nextcloud on my lan (to synchronize large files) and use “nextcloud on internet” to permit calls and shared file both using only a one domain.

in a short, using public domain all synchronized files pass through internet instead using local gigabit network

i hope you understand
Thank you

Normally you use on the local network and on the internet the same name eg. nextcloud.condizio.com. Then you need for all your clients only one configuration.
Search Hairpinning and NAT Loopback.

hi,
thank you but in this case ok, with airpinning the request exit to internet and loopback to local network so my client (inside lan) can reach internal nextcloud instance.
but in this case i suppose it still uses internet connection that is my problem (internet is 10mb download and 10mb in upload).
want i want to do is (in this case) use local gigabit network and when my client is at home use internet

You can check if your router supports setting a hairpinning / loopback. Then you would tell your router, to always resolve requests to nextlcoud.condizio.com directly to your local IP.

I think not. Please post more details e.g. your internal network infrastructure, logs, configs, screenshots, … It is not a nextcloud problem, it is a network problem.

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.

They don’t really pass through the internet. But they have to be re-routed and have to pass the NAT in your router, which costs CPU time. Not all router models, especially consumer grade routers, do handle NAT loopback well.

The solution would be to run a local DNS server (you could use something like Pi-hole), or if you are lucky your router supports something like local DNS host overrides. That way cloud.yourdomain.tld would resolve to the local IP address of your server instead of the WAN address and traffic would only hit the switch of your router, which then would most likely result in much better speed.

Another advantage of this would be, that you can see the effective IP addresses of the devices that are connecting to your server in the logs, instead of the IP of your router.