{% if deployment_type in ['stg', 'prod'] %}
WSGIDaemonProcess resultsdb user=apache group=apache threads=20 processes=4
{% else %}
WSGIDaemonProcess resultsdb user=apache group=apache threads=5
{% endif %}
WSGIScriptAlias /{{ resultsdb_endpoint }} /usr/share/resultsdb/resultsdb.wsgi
WSGISocketPrefix run/wsgi

# this isn't the best way to force SSL but it works for now
#RewriteEngine On
#RewriteCond %{HTTPS} !=on
#RewriteRule ^/resultsdb/admin/?(.*) https://%{SERVER_NAME}/$1 [R,L]

<Directory /usr/share/resultsdb>
    WSGIProcessGroup resultsdb
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptReloading On
    <IfModule mod_authz_core.c>
        # Apache 2.4
        <RequireAny>
            Require method GET
            Require ip 127.0.0.1 ::1{% for host in allowed_hosts %} {{ host }}{% endfor %}

        </RequireAny>
    </IfModule>
    <IfModule !mod_auth_core.c>
        Order allow,deny
        Allow from all
    </IfModule>

</Directory>

#Alias /resultsdb/static /var/www/resultsdb/resultsdb/static

#<Directory /var/www/resultsdb/resultsdb/static>
#Order allow,deny
#Allow from all
#</Directory>
