Created
December 15, 2015 23:06
-
-
Save fgbreel/f323f3e38cb6eb0750c9 to your computer and use it in GitHub Desktop.
Ansible template for Apache2.4 with Load Balancing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_ssl.c> | |
<VirtualHost _default_:443> | |
ServerAdmin [email protected] | |
DocumentRoot {{ document_root }} | |
LogLevel error | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
SSLEngine on | |
SSLProxyEngine on | |
SSLCertificateFile {{ ssl_certificate_path }} | |
SSLCertificateKeyFile {{ ssl_certificate_key_path }} | |
SSLCACertificateFile {{ ssl_ca_certificate_path }} | |
ProxyPreserveHost On | |
ProxyAddHeaders On | |
RequestHeader set X-Forwarded-Proto 'https' | |
RequestHeader set Https 'on' | |
BalancerPersist On | |
<Proxy balancer://default> | |
{% for host in groups['app'] %} | |
BalancerMember http://{{ host }}:8080 | |
{% endfor %} | |
</Proxy> | |
<Location /> | |
ProxyPass balancer://default/ | |
ProxyPassReverse balancer://default | |
</Location> | |
</VirtualHost> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
must be used with: