# Deployment using mod_wsgi
#
# Useful documentation:
# https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/

# Force the use of ssl:
#<IfModule mod_rewrite.c>
#    RewriteEngine on
#    RewriteCond %{HTTPS} off
#    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
#</IfModule>


# Limit threads forked:
# prefork MPM 
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 256
MaxRequestsPerChild 0

WSGIDaemonProcess nitrateapp processes=2
WSGIProcessGroup nitrateapp
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /usr/lib/python3.7/site-packages/tcms/wsgi.py
WSGIPassAuthorization On

<Location "/">
    # ====================
    # Handler for mod_wsgi
    # ====================
    SetHandler wsgi-script

    Options All
    Require all granted
    LimitRequestBody 10485760
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript text/css

    ErrorDocument 401 "Your request is unauthorization."
</Location>

# Make sure static files are collected to this dir
Alias /static /usr/share/nitrate/static

<Location "/static">
    SetHandler None
    Options -Indexes

    # Disable auth on the static content, so that we're aren't forced to
    # use Kerberos.  Doing so would remove "Expires" headers from the static
    # content, which would lead to poor page-load times.
    AuthType none
    Satisfy Any
    Allow from All

    # Many file types are likely to benefit from compression
    # Enable gzip compression on them:
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/x-javascript text/css

    # Set far-future Expires headers on static content
    # (trac 184):
    ExpiresActive On
    ExpiresDefault "access plus 10 years"
</Location>
