Prevent public access to login portal

Hi.

We are looking for a solution to prevent public access to the login portal (e.g https://my.nextcloud.com/login) while maintaining the possibility to share files by link to the public.

The login portal shall only be available to users from the internal network.

Any ideas are most welcome.

Best regards

Rob

Some Firewalls/UTM allow this. e.g. the Sophos UTM has this in “Webserver Protection - Web Application Firewall - Site Path Routing”