Skip to content

Instantly share code, notes, and snippets.

@olof
Created April 19, 2018 16:11
Show Gist options
  • Save olof/071cbfcb3ef35883a2ee35307d771607 to your computer and use it in GitHub Desktop.
Save olof/071cbfcb3ef35883a2ee35307d771607 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/example.com">
Options Indexes FollowSymLinks
AllowOverride none
Allow from any
</Directory>
RewriteEngine on
RewriteRule !^/.well-known($|/) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile {{certdir}}/cert.pem
SSLCertificateKeyFile {{certdir}}/privkey.pem
SSLCertificateChainFile {{certdir}}/fullchain.pem
<Directory /var/www/html/example.com>
Options Indexes FollowSymLinks
AllowOverride none
Allow from any
</Directory>
</VirtualHost>
# vim: syntax=apache:ts=4:sw=4:sts=4:sr:et
@olof
Copy link
Author

olof commented Apr 19, 2018

yeah, and {{certdir}} is not at all an indication that this was originally a jinja template :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment