Access to shared files from the Internet like as Edge server

I use the Nextcloud server inside the network. There is no access from the Internet.
I need to implement a setting when shred files, some users (ideally included in a Active Directory group) will be available from the Internet.
And from the Internet should not be a login page or shared other users’ files.

So far the only thing that came up - get URLs list from the database, and load it as rules to reverse proxy like nginx