From Boldcore's wiki
Revision as of 10:44, 7 March 2017 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Working VirtualHost config for reverse proxy

...working on my servers.

Frequent mistakes

Hosts file

Include all vhost addresses in /etc/hosts

VHosts on reverse proxy server

Virtual hosts where the webs are actually located must be IP based.
Each on different IP with different domain name (optional)
With IPv6, this is easy ;))

<VirtualHost address.tld:443>
 ServerName address.tld
 ServerAlias address.tld
 ProxyPass  / https://web.server.address/
 ProxyPassReverse / https://web.server.address/

 ProxyRequests Off
 ProxyPreserveHost On
 SSLProxyCheckPeerCN off
 SSLProxyCheckPeerName off
 SSLProxyCheckPeerExpire off
 
 ## For letsencrypt
 Include /etc/letsencrypt/options-ssl-apache.conf ## For letsencrypt
 SSLCertificateFile /etc/letsencrypt/live/address.tld/cert.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/address.tld/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/address.tld/chain.pem
 SSLProxyEngine On
 
</VirtualHost>