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>
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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.