Skip to content

Instantly share code, notes, and snippets.

@abouvier
Created August 14, 2017 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abouvier/c205a2bb62c26232558d7868ec994181 to your computer and use it in GitHub Desktop.
Save abouvier/c205a2bb62c26232558d7868ec994181 to your computer and use it in GitHub Desktop.
Apache mod_macro
<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