Created
August 14, 2017 21:52
-
-
Save abouvier/c205a2bb62c26232558d7868ec994181 to your computer and use it in GitHub Desktop.
Apache mod_macro
This file contains 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
<Macro HSTS> | |
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" | |
</Macro> | |
<Macro LetsEncrypt $domain> | |
SSLEngine on | |
SSLCertificateKeyFile /etc/letsencrypt/live/$domain/privkey.pem | |
SSLCertificateFile /etc/letsencrypt/live/$domain/fullchain.pem | |
Use HSTS | |
</Macro> | |
<Macro Log $vhost> | |
CustomLog ${APACHE_LOG_DIR}/access.$vhost.log combined | |
</Macro> | |
<Macro CloudflareAuth> | |
SSLVerifyClient require | |
SSLVerifyDepth 1 | |
SSLCACertificatePath /etc/ssl/certs/ | |
</Macro> | |
<Macro ForceHTTPS $domain> | |
<VirtualHost *:80> | |
ServerName $domain | |
RedirectPermanent / https://$domain/ | |
</VirtualHost> | |
</Macro> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment