I have one WAN-IP with an apache webserver which host A.domain.com and I will reverse proxy to B.domain.com to another server in the same local network.
Without SSL I solved it this way in the vhosts:
<VirtualHost *:80>
ServerName Z.domain.com
ProxyRequests Off
ProxyPass / http://1.1.1.7/
ProxyPassReverse / http://1.1.1.7/
but with SSL enabled it doesn't work this way...
for better understanding I tried to draw it:
-- A.domain.com(local IP:1.1.1.1) | WAN --¦Firewall (NAT to 1.1.1.1) ¦-- LAN | -- B.domain.com(local IP:1.1.1.2)
Server 1.1.1.1 should redirect to 1.1.1.2
my config /etc/apache2/sites-available/B.domain.com.conf:
<VirtualHost *:443>
ServerName B.domain.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/B.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/B.domain.com/privkey.pem
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / https://1.1.1.2/
ProxyPassReverse / https://1.1.1.2/
</VirtualHost>
I have activated it with:a2ensite B.domain.com
and restarted apache.
Result is an internal server error if i call the site.
Without the I have the same fault.
If i call apache2ctl -S
it looks all good.