Nextcloud Configuration with Intranet Access (Tailscale) and Secure External Shares (via Tailscale Funnel)

Hello Nextcloud Community,

I manage a Nextcloud instance on a Synology NAS via Docker, and I’m looking to configure access specifically for my business needs, using Tailscale.

My objective is twofold:

  1. Private Internal Access: For my internal users, Nextcloud is fully accessible via a private Tailscale virtual network (e.g., https://nextcloud.mydomain.ts.net). This access works perfectly and is secure.
  2. Controlled External Shares: I want public sharing links generated by Nextcloud to be accessible to external users (non-VPN) via a dedicated public URL (for example, https://share.mydomain.com).

The challenge lies in the fact that I have no open ports on my router for security reasons. For public sharing exposure, I’m using Tailscale Funnel, a service that establishes an outbound tunnel from my Synology. A Docker reverse proxy (tsbridge) is used to direct traffic to my Nextcloud container.

Nextcloud automatically generates sharing links. Currently, my config.php is configured for internal access.

My questions are:

  1. Share URL Management: How should I configure config.php (specifically overwrite.cli.url, overwritehost, trusted_domains, trusted_proxies) so that Nextcloud generates sharing links with https://share.mydomain.com, while still functioning normally for internal access via https://nextcloud.mydomain.ts.net?
  2. Selective Exposure: Does Nextcloud have mechanisms (e.g., within the container’s internal Apache/Nginx, or via modules) that could help limit public domain access (share.mydomain.com) strictly to sharing paths (/s/), to prevent the login page or other interfaces from being publicly accessible? My reverse proxy (tsbridge) seems to expose ports rather than filter paths.
  3. Intranet/Extranet Deployment Recommendations: Are there any recommended configurations or “best practices” for Nextcloud in an environment where the primary access is via VPN (like Tailscale) and only shares are intended to be public and ultra-secure?

Any advice or configuration examples would be greatly appreciated. Thank you!

found your post in google search.
I got it working
tsbridge.service.name=nextcloud
tsbridge.enable=true
tsbridge.service.insecure_skip_verify=true
tsbridge.service.backend_addr=https://192.168.1.3:5443