I found the solution to my problem!

If you want to configure a reverse proxy with HTTPS you have to install the 
SSL-certificates on the host (and not in the remote server or virtual machine)!

This is the final virtual hosts file:

ServerName localhost
DocumentRoot /var/www/html/

<VirtualHost *:80 >
ServerName [your.domain.com]
ProxyPreserveHost On
ProxyPass / http://[IP address virtual machine]/
ProxyPassReverse / http://[IP address virtual machine]/
RewriteEngine on
RewriteCond %{SERVER_NAME} =[your.domain.com]
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443 >
ServerName [your.domain.com]
SSLProxyEngine on
ProxyPreserveHost On
ProxyPass / http://[IP address virtual machine]/
ProxyPassReverse / http://[IP address virtual machine]/
SSLCertificateFile /etc/letsencrypt/live/[your.domain.com]/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/[your.domain.com]/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

For the installation of the SSL-certificate I used Let's Encrypt. No need to 
use any other third-party software!

All the steps that I made, can be found here:
https://jeroenverhoeckx.com/build-your-own-personal-cloud.html

--------------------------------------------------------
Support the independent web, use 
[Firefox](https://www.mozilla.org/en-US/firefox/new/)

Reply via email to