#
# mirrormanager2 moves the publiclist web page to the frontend server
#
{% if env == "staging" %}
Redirect /publiclist https://admin.stg.fedoraproject.org/mirrormanager
RewriteEngine On
RewriteRule ^/publiclist/(.+[^/])/?$ https://admin.stg.fedoraproject.org/mirrormanager/mirrors/$1 [R,L]
{% else %}
Redirect /publiclist https://admin.fedoraproject.org/mirrormanager
Alias /static /var/lib/mirrormanager/mirrorlists/static/
RewriteEngine On
RewriteRule ^/publiclist/(.+[^/])/?$ https://admin.fedoraproject.org/mirrormanager/mirrors/$1 [R,L]
{% endif %}

<Directory /var/lib/mirrormanager/mirrorlists>
        Options Indexes FollowSymLinks
</Directory>

WSGIDaemonProcess mirrorlist user=apache processes={{ mirrorlist_procs }} threads=1 display-name=mirrorlist maximum-requests=1000

WSGIScriptAlias /metalink /usr/share/mirrormanager2/mirrorlist_client.wsgi
WSGIScriptAlias /mirrorlist /usr/share/mirrormanager2/mirrorlist_client.wsgi

# Set this if you do not have a Reverse Proxy (HTTP Accelerator) that
# is in front of your application server running this code.
# SetEnv mirrorlist_client.noreverseproxy 1

ServerLimit           900
MaxRequestWorkers     900

<Location /mirrorlist>
    WSGIProcessGroup mirrorlist
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
</Location>

<Location /metalink>
    WSGIProcessGroup mirrorlist
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
</Location>

<Location /static>
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
</Location>

#
# Listen on 443 here 
#
Listen 443
