<VirtualHost *:80>
    ServerName ${APACHE_SERVER_NAME}
    DocumentRoot ${APACHE_DOCUMENT_ROOT}
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
    ServerName ${APACHE_SERVER_NAME}
    DocumentRoot ${APACHE_DOCUMENT_ROOT}
    SSLEngine on
    SSLCertificateFile      /etc/ssl/certs/mycert.crt
    SSLCertificateKeyFile /etc/ssl/private/mycert.key
</VirtualHost>