Hello Apache administrators!
In summary I have the following question:
How do I correctly configure a reverse proxy that redirects to a website with HTTPS?
My set-up
A RHEL server (host) with one virtual machine.
The website is running on the virtual machine (also RHEL).
Virtual host file on the host
ServerName localhost
DocumentRoot /var/www/html/
<VirtualHost *:80 >
ServerName [my.domain.com]
ProxyPreserveHost On
</VirtualHost>
<VirtualHost *:443 >
ServerName [my.domain.com]
SSLProxyEngine on
ProxyPreserveHost On
</VirtualHost>
Virtual host file on the virtual machine
ServerName localhost
<VirtualHost *:80 >
ServerName [my.domain.com]
DocumentRoot /var/www/html/
RewriteEngine on
RewriteCond %{SERVER_NAME} =[my.domain.com]
</VirtualHost>
<VirtualHost *:443>
ServerName [my.domain.com]
DocumentRoot /var/www/html/
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
I installed the SSL certificate with certbot of Let's Encrypt and I got the message that it was installed correctly.
Problem
When I go to my domain, Firefox tells me that the website isn't secure.
Question
What
do I need to add to the virtual host file on the host to correctly pass
all HTTPS traffic to the virtual host on the virtual machine?
Ideally (if possible) I don't request for another SSL certificate or copy the certificate on the virtual machine to the host.
I'm documenting all the steps on a blog post so others can repeat the steps that I make. You can find this blog post here (still work in progress / draft).
Any help is appreciated! I searched on the internet but couldn't find any good documentation for this specific problem.
Your sincerely,
Scott Trakker
--------------------------------------------------------
Support the independent web, use Firefox