Configure apache to allow access for shared links only

Hi everyone,

I am using nextcloud 13.06 in my local network only.
However, I want to share some files with others over the internet and therefore grant access to those only.

I tried to configure within apache2 the following in order to limit the access:

<Location /nextcloud/index.php/s/>
   Allow from all
</Location>
   
<Location />
  Allow from 192.168.1.0/255.255.255.0
</Location> 

The problem with this config is that the shared sites are completely corrupted since some of the content and the scripts from a different directory need to be accessed.

Has anyone tried this before ?

Cheers

The following definition within the apache vhost config solves my case:

<Location "/">
        Require all denied
</Location>

<Location ~ "/index.php/(s|apps|css|js)">
        Require all granted
</Location>
<Location "/apps">
        Require all granted
</Location>
<Location "/core">
        Require all granted
</Location>

However, I do not know what else might be accessable by revealing “apps”, “core” etc. ;
At the moment those paths are needed to display the shared link correctly incl. the content.