I am at the moment testing the next situation in our lab surroundings to make our manufacturing web pages extra accessible. I would like to have the ability to replace/reboot a single server with out taking down any of our web sites. I am utilizing Debian for our working system and Apache for the net and proxy providers.
I am standing up two Apache proxy servers for redundancy – these will each have public IPs with A information in our DNS for sandbox.instance.com. Behind the 2 proxy servers can be 2 or extra net servers. I am at the moment utilizing 2 beneath as increasing to three or extra is only a matter of including extra entries per server.
Under is what I began writing for the virtualhost of every proxy server which I am nonetheless attempting to iron out. I would like to have the ability to do the next:
1 – Redirect http to https on the proxy host if doable.
2 – Guarantee SSL encryption stays intact (consumer -> proxy -> net server -> proxy -> consumer)
3 – Redirect our WordPress admin pages (/wp-admin) to a particular net server behind the proxy
<VirtualHost *:80>
<Proxy balancer://mycluster>
ProxySet stickysession=PHPSESSIONID
BalancerMember http://10.10.100.101
BalancerMember http://10.10.100.102
</Proxy>
ProxyPreserveHost On
ServerName sandbox.instance.com
ProxyPass /.well-known/acme-challenge/ http://10.10.100.101/.well-known/acme-challenge/
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
<Proxy balancer://mycluster>
ProxySet stickysession=PHPSESSIONID
BalancerMember http://10.10.100.101
BalancerMember http://10.10.100.102
</Proxy>
ProxyPreserveHost On
ServerName sandbox.instance.com
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
SSLCertificateFile /and many others/letsencrypt/reside/sandbox.instance.com/fullchain.pem
SSLCertificateKeyFile /and many others/letsencrypt/reside/sandbox.instance.com/privkey.pem
Embody /and many others/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
If somebody is ready to accomplish this with HAProxy or Nginx, I am open to this as nicely. Particularly for the two proxy servers.