DocumentRoot /afs/athena.mit.edu/contrib/scripts/web_scripts/home
SuExecUserGroup scripts users
UserDir enabled
UserDir web_scripts
# Comment the following line out to take the machine out of the LVS pool
# You'll also need to prevent it from listening on 443 or 444
Alias /heartbeat /afs/athena.mit.edu/contrib/scripts/web_scripts/heartbeat
Alias /src /afs/athena.mit.edu/contrib/scripts/src
Redirect /sql https://scripts.mit.edu/~sql

<IfModule mod_status.c>
    <Location "/server-status">
        AuthType Basic
        AuthName "scripts status"
        AuthBasicProvider file
        AuthUserFile /etc/munin/apache-htpasswd
        Require valid-user
        SetHandler server-status
        PermitStatusHandler on
    </Location>
</IfModule>

<Location ~ "/(robots\.txt|favicon\.ico)">
    RewriteEngine On
    RewriteBase /~scripts
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .*(favicon\.ico) $1 [L,NS]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .*(robots\.txt) $1 [L,NS]
</Location>

LogFormat "%V %t %>s \"%U\"" tildelog
CustomLog "logs/tilde_log" tildelog "expr=%{CONTEXT_PREFIX} =~ m#^/~#"

# As long as we support scripts/~ URLs, we need to disable Service
# Workers on them for security.
# https://infrequently.org/2014/12/psa-service-workers-are-coming/
<If "-n req('Service-Worker')">
    Require all denied
</If>
