a2enmod ssl
a2enmod proxy_http
a2enmod headers

##################################################
<VirtualHost *:80>

	ServerName gckesaco.ddns.net
	Redirect permanent / https://gckesaco.ddns.net

</VirtualHost>

<VirtualHost *:80>

	ServerName nckesaco.ddns.net
	Redirect permanent / https://nckesaco.ddns.net

</VirtualHost>

<VirtualHost *:80>

	ServerName jitkesaco.ddns.net
	Redirect permanent / https://jitkesaco.ddns.net

</VirtualHost>


<VirtualHost *:443>

    ServerName gckesaco.ddns.net

    SSLEngine On
    SSLCertificateFile /etc/ssl/letsencrypt/gckesaco.ddns.net/fullchain.pem
    SSLCertificateKeyFile /etc/ssl/letsencrypt/gckesaco.ddns.net/privkey.pem
    #SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
	
        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyVerify none
        ProxyPreserveHost On
        ProxyPass / https://192.168.1.113/
        ProxyPassReverse / https://192.168.1.113/
		RedirectMatch ^/$ https://192.168.1.113/
		RequestHeader set X-Forwarded-Proto https
		
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
	
</VirtualHost>

<VirtualHost *:443>

     ServerName nckesaco.ddns.net
    
     <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
     </IfModule>

    SSLEngine On
    SSLCertificateFile /etc/ssl/letsencrypt/nckesaco.ddns.net/fullchain.pem
    SSLCertificateKeyFile /etc/ssl/letsencrypt/nckesaco.ddns.net/privkey.pem
    #SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyVerify none
        ProxyPreserveHost On
        ProxyPass / https://192.168.2.2/
        ProxyPassReverse / https://192.168.2.2/
		RedirectMatch ^/$ https://192.168.2.2
		RequestHeader set X-Forwarded-Proto https
		
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:443>

     ServerName jitkesaco.ddns.net

    SSLEngine On
	SSLCertificateFile /etc/letsencrypt/live/jitkesaco.ddns.net/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/jitkesaco.ddns.net/privkey.pem
    #SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyVerify none
        ProxyPreserveHost On
        ProxyPass / https://192.168.4.2/
        ProxyPassReverse / https://192.168.4.2/
		RedirectMatch ^/$ https://192.168.4.2
		RequestHeader set X-Forwarded-Proto https
		
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>