<VirtualHost *:80>
    ServerName acs._VAR_DOMAIN
    DocumentRoot /srv/www

    RewriteEngine On
    RewriteRule ^/?\.well-known/acme-challenge - [L]
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

    ErrorLog ${APACHE_LOG_DIR}/acs-ui-error.log
    CustomLog ${APACHE_LOG_DIR}/acs-ui-access.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerName acs._VAR_DOMAIN
    Protocols h2 http/1.1
    DocumentRoot /srv/www

    SSLEngine on
    SSLCertificateFile /etc/ssl/acme-sh/acs._VAR_DOMAIN.pem
    SSLCertificateKeyFile /etc/ssl/acme-sh/acs._VAR_DOMAIN.key
    Header always add Strict-Transport-Security "max-age=15768000"

    AllowEncodedSlashes NoDecode
    ProxyPass / http://127.0.0.1:2979/ nocanon
    ProxyPassReverse / http://127.0.0.1:2979/
    ProxyPreserveHost on

    ErrorLog ${APACHE_LOG_DIR}/acs-ui-error.log
    CustomLog ${APACHE_LOG_DIR}/acs-ui-access.log combined
</VirtualHost>

<VirtualHost *:7547>
    ServerName acs._VAR_DOMAIN
    Protocols h2 http/1.1
    DocumentRoot /srv/www

    SSLEngine on
    SSLCertificateFile /etc/ssl/acme-sh/acs._VAR_DOMAIN.pem
    SSLCertificateKeyFile /etc/ssl/acme-sh/acs._VAR_DOMAIN.key
    Header always add Strict-Transport-Security "max-age=15768000"

    AllowEncodedSlashes NoDecode
    ProxyPass / http://127.0.0.1:2999/ nocanon
    ProxyPassReverse / http://127.0.0.1:2999/
    ProxyPreserveHost on

    ErrorLog ${APACHE_LOG_DIR}/acs-cwmp-error.log
    CustomLog ${APACHE_LOG_DIR}/acs-cwmp-access.log combined
</VirtualHost>
