#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#

<VirtualHost 83.223.94.182:80 83.223.94.182:80 [2a01:37:3000:0:0:53df:5eb6:0]:80 [2a01:37:3000:0:0:53df:5eb6:0]:80>
    ServerName sendfile.demo.hs.coop
    ServerAlias  *.sendfile.demo.hs.coop
    ServerAdmin webmaster@sendfile.demo.hs.coop

    SuexecUserGroup hsh12-nextcloud hsh12

    PassengerEnabled Off
    PassengerUser hsh12-nextcloud
    PassengerGroup hsh12
    PassengerAppRoot /home/doms/sendfile.demo.hs.coop/app/

    DocumentRoot /home/doms/sendfile.demo.hs.coop/htdocs

    Alias /fastcgi-bin/ /home/doms/sendfile.demo.hs.coop/fastcgi/

    <Directory />
        PassengerEnabled Off
        Options -ExecCGI -Includes +Indexes -MultiViews +SymLinksIfOwnerMatch
    </Directory>

    <Directory /home/doms/sendfile.demo.hs.coop/>
        PassengerEnabled Off
        PassengerPython /usr/bin/python3
        PassengerNodejs /usr/bin/node
        PassengerRuby /usr/bin/ruby
        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,Includes,Indexes,MultiViews
    </Directory>


    <Location /fastcgi-bin/>
        PassengerEnabled Off
        SetHandler fcgid-script
        Options +ExecCGI +Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>

    <Location /autodiscover/autodiscover.xml>
        ProxyPreserveHost Off
        ProxyPass http://127.0.0.1:8082/
    </Location>

    <Location /.well-known/autoconfig/mail/config-v1.1.xml>
        ProxyPreserveHost Off
        ProxyPass http://127.0.0.1:8081/
    </Location>

    RewriteEngine On
    RewriteOptions Inherit

    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.sendfile.demo.hs.coop\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/sendfile.demo.hs.coop/subs/${tolower:%1}  -d
    RewriteRule ^(.*) /home/doms/sendfile.demo.hs.coop/subs/${tolower:%1}$1  [last]

    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    AddType application/x-httpd-php .php 
    Action application/x-httpd-php /fastcgi-bin/hs-phpstub
</VirtualHost>

<VirtualHost 83.223.94.182:443 83.223.94.182:443 [2a01:37:3000:0:0:53df:5eb6:0]:443 [2a01:37:3000:0:0:53df:5eb6:0]:443>
    ServerName sendfile.demo.hs.coop
    ServerAlias  *.sendfile.demo.hs.coop
    ServerAdmin webmaster@sendfile.demo.hs.coop

    SuexecUserGroup hsh12-nextcloud hsh12

    PassengerEnabled Off
    PassengerUser hsh12-nextcloud
    PassengerGroup hsh12
    PassengerAppRoot /home/doms/sendfile.demo.hs.coop/app-ssl/

    SSLEngine On
    SSLCertificateFile /etc/apache2/pems-enabled/sendfile.demo.hs.coop.crt
    SSLCertificateKeyFile /etc/apache2/pems-enabled/sendfile.demo.hs.coop.key
    SSLCertificateChainFile /etc/apache2/pems-enabled/sendfile.demo.hs.coop.chain

    DocumentRoot /home/doms/sendfile.demo.hs.coop/htdocs-ssl

    Alias /fastcgi-bin/ /home/doms/sendfile.demo.hs.coop/fastcgi-ssl/

    <Directory />
        SSLRequireSSL On
        PassengerEnabled Off
        Options -ExecCGI -Includes +Indexes -MultiViews +SymLinksIfOwnerMatch

        ##XSendFile On
        ##XSendFilePath .
    </Directory>

    <Directory /home/doms/sendfile.demo.hs.coop/>
        PassengerEnabled Off
        PassengerPython /usr/bin/python3
        PassengerNodejs /usr/bin/node
        PassengerRuby /usr/bin/ruby

        #XSendFile On
        #XSendFilePath /home/doms/sendfile.demo.hs.coop

        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,Includes,Indexes,MultiViews,SymLinksIfOwnerMatch
    </Directory>


    <Location /fastcgi-bin/>
        PassengerEnabled Off
        SetHandler fcgid-script
        Options +ExecCGI +Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>

    <Location /autodiscover/autodiscover.xml>
        ProxyPreserveHost Off
        ProxyPass http://127.0.0.1:8082/
    </Location>

    <Location /.well-known/autoconfig/mail/config-v1.1.xml>
        ProxyPreserveHost Off
        ProxyPass http://127.0.0.1:8081/
    </Location>

    RewriteEngine On
    RewriteOptions Inherit

    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.sendfile.demo.hs.coop\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/sendfile.demo.hs.coop/subs-ssl/${tolower:%1}  -d
    RewriteRule ^(.*) /home/doms/sendfile.demo.hs.coop/subs-ssl/${tolower:%1}$1  [last]

    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    AddType application/x-httpd-php .php
    Action application/x-httpd-php /fastcgi-bin/hs-phpstub
</VirtualHost>
