From Boldcore's wiki
(Created page with "= Working VirtualHost config for reverse proxy = <pre> <VirtualHost address.tld:443> ServerName address.tld ServerAlias address.tld ProxyPass / https://reverse.proxy.addr...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Working VirtualHost config for reverse proxy = | = 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.<br> | ||
+ | Each on different IP with different domain name (optional)<br> | ||
+ | With IPv6, this is easy ;)) | ||
<pre> | <pre> | ||
Line 5: | Line 17: | ||
ServerName address.tld | ServerName address.tld | ||
ServerAlias address.tld | ServerAlias address.tld | ||
− | ProxyPass / https:// | + | ProxyPass / https://web.server.address/ |
− | ProxyPassReverse / https:// | + | ProxyPassReverse / https://web.server.address/ |
ProxyRequests Off | ProxyRequests Off | ||
Line 22: | Line 34: | ||
</VirtualHost> | </VirtualHost> | ||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> |
Latest revision as of 05:44, 7 March 2017
Contents
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>