Apache config - ProxyPass and Alias

Indico docs suggest this set of directives to put into Apache config file:

    AliasMatch "^/(images|fonts)(.*)/(.+?)(__v[0-9a-f]+)?\.([^.]+)$" "/opt/indico/web/static/$1$2/$3.$5"
    AliasMatch "^/(css|dist|images|fonts)/(.*)$" "/opt/indico/web/static/$1/$2"
    Alias /robots.txt /opt/indico/web/static/robots.txt

    SetEnv UWSGI_SCHEME https
    ProxyPass / unix:/opt/indico/web/uwsgi.sock|uwsgi://localhost/

The problem with this is that ProxyPass overrides any Alias directives and in reality everything goes to uwsgi.

I wanted to override /robots.txt alias but it did not work, this is how I discovered that ProxyPass takes precedence. To fix that issue for robots.txt I had to add line:

    ProxyPass /robots.txt !

before the ProxyPass / ....

Naturally all AliasMatch directives are ignored too, so all static files are served by uwsgi.

Just to let you know in case someone else encounters this issue.

Andy

PR to the docs appreciated :slight_smile: We don’t use Apache ourselves…

Based on a quick google it seems like ProxyPass <anything from aliasmatch> ! disables it, but not sure if it supports the regexps.