0

I'm trying to create an alias to intercept some url to serve from file system directly with Apache 2.4

In my virtualhost, I have: DocumentRoot /var/www/mysubroot

I have a location on "/" in order to send all to the apache balancer

<Location / >
        ProxyPass balancer://my-cluster/
        ProxyPassReverse /      
        # Add the unique id on the header
        RequestHeader set UNIQUE_ID %{UNIQUE_ID}e
</Location>

I tried to add an alias to serve some content from the filesystem but it is never functional

Alias "/hidden/" "/var/www/hidden/"
<Location /hidden/ >
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
</Location>

A call to http://myvirtualhost/hidden/mysecretfolder/test.txt is rendered by the Location / and not the alias

Any clue to how make it work (even with other solution than alias) ?


Also I have others location directives in the virtualhost and have no issue with them as they "proxy" as attended.

<Location /rainloop/ > 
    ProxyPass http://10.14.1.103/rainloop/
    ProxyPassReverse /rainloop/         
</Location>
DevOps
  • 720
  • 5
  • 16

1 Answers1

2

In fact I add ProxyPass "!" in the location of the alias and the block need to be after the bloc of the Location /

Alias "/hidden/" "/var/www/hidden/"
<Location /hidden/ >
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ProxyPass "!"
</Location>
DevOps
  • 720
  • 5
  • 16