Skip to content

Instantly share code, notes, and snippets.

@riipandi
Created June 4, 2020 01:54
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 riipandi/f7a7efaf6cb68a2ffb63c6b40ce9f380 to your computer and use it in GitHub Desktop.
Save riipandi/f7a7efaf6cb68a2ffb63c6b40ce9f380 to your computer and use it in GitHub Desktop.
apache ssl
<VirtualHost *:80>
ServerName ${vhost}
ServerAlias www.${vhost}
DocumentRoot /var/www/${vhost}/public/html
Redirect / https://${vhost}
</VirtualHost>
<VirtualHost *:443>
Header set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
Header set Content-Security-Policy "default-src https://${vhost}:443"
Header set x-frame-options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy "no-referrer"
ServerName ${vhost}
DocumentRoot /var/www/${vhost}/public/html
SSLEngine on
SSLHonorCipherOrder on
SSLCipherSuite 'EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA:EECDH:EDH+AESGCM:EDH:+3DES:ECDH+AESGCM:ECDH+AES:ECDH:AES:HIGH:MEDIUM:!RC4:!CAMELLIA:!SEED:!aNULL:!MD5:!eNULL:!LOW:!EXP:!DSS:!PSK:!SRP:!SSLv3:!SSLv2:!TLSv1'
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile /etc/letsencrypt/live/${vhost}/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/${vhost}/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/${vhost}/chain.pem
Options Indexes FollowSymLinks
ErrorLog /var/www/${vhost}/logs/error.log
CustomLog /var/www/${vhost}/logs/requests.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment