<VirtualHost *:80>
ServerAdmin your-email
ServerName your-privkey-domain
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
ErrorLog ${APACHE_LOG_DIR}/your-privkey-domain.error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/your-privkey-domain.access.log combined
#ProxyPass / http://your-privkey-domain:port
#ProxyPassReverse / https://your-privkey-domain:port
</VirtualHost>
<VirtualHost *:443>
ServerAdmin your-email
ServerName your-privkey-domain
ProxyRequests Off
SSLProxyEngine on
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
SSLEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile "/etc/letsencrypt/live/your-privkey-domain/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/your-privkey-domain/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/your-privkey-domain/chain.pem"
ProxyPass / https://your-privkey-domain:port nocanon
ProxyPassReverse / https://your-privkey-domain:port
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
ErrorLog ${APACHE_LOG_DIR}/your-privkey-domain.error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/your-privkey-domain.access.log combined
</VirtualHost>