Achtung: der reine Apache Reverse funktioniert nicht mit WordPress ! Ansonsten alles gut
## install apache2 ##
apt-get update
apt-get install apache2 -y
## enable moduls ##
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
service apache2 restart
## create config for 1st client ##
nano /etc/apache2/sites-enabled/server1.conf
<VirtualHost *:80>
ServerName subdomain11.yourdomain.com
ProxyPreserveHost On
DocumentRoot /var/www/html
ProxyPass /.well-known !
ProxyPass / http://10.1.1.11:80/
ProxyPassReverse / http://10.1.1.11:80/
</VirtualHost>
## create config for 2nd client ##
nano /etc/apache2/sites-enabled/server2.conf
<VirtualHost *:80>
ServerName subdomain12.yourdomain.com
ProxyPreserveHost On
DocumentRoot /var/www/html
ProxyPass /.well-known !
ProxyPass / http://10.1.1.12:80/
ProxyPassReverse / http://10.1.1.12:80/
</VirtualHost>
## restart apache server ##
service apache2 restart
## install Let’s Encrypt Certbot ##
apt-get install certbot -y && apt-get install python3-certbot-apache -y
## create certificates ##
certbot --apache
#–> certificate only lasts 90 days
#install crontab
crontab -e
0 1 * * * /usr/bin/certbot renew & > /dev/nul
Probleme mit ssl cert
#In the wp-config.php file, you have to add:
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
gefunden auf: https://apfelcast.com/reverse-proxy-konfigurieren-mit-ssl-verschluesselung-via-lets-encrypt-einfache-beginner-anleitung/