Access nextcloud through local access and also through the tunnel

Hello, I have my nextcloud available for external access through a cloudflare tunnel, I configured the tunnel using a domain that I already owned, and I set it so that the tunnel redirected traffic to my local address. However, I want that when users are connected to the local network they access nextcloud via the localhost url, but when I try to access using the local link the user is initially not authenticated. Is there any configuration I should do?

So, simply put, I want to be able to access my nextcloud through the domain that I configured the cloudflare tunnel and also through the default local link that nextcloud provides after installation!

config.php:

when I try to enter nextcloud by accessing the local link:

If you need any further configuration, just ask me and I’ll send it to you, thank you!

If you are running a local DNS resolver, you could run a split DNS setup. This would allow you to return a different IP address to your local users for the same host name. You can find more information on this topic via the forum search.

If the computers always remain in the same network, you could also create a host entry.

The nextcloud system is used in an office with a few employees, all computers will be on the same network. External access through the tunnel would be for possible uses that need to be done when someone is not in the office with access to the local network.

In that case, what would you advise me to do?

I’m a beginner in this world so I’m still a bit lost…