Skip to content

Instantly share code, notes, and snippets.

@useless-stuff
Last active February 9, 2023 16:38
Show Gist options
  • Select an option

  • Save useless-stuff/761221cd4046dd31b994 to your computer and use it in GitHub Desktop.

Select an option

Save useless-stuff/761221cd4046dd31b994 to your computer and use it in GitHub Desktop.
TLS/SSL - Let's Encrypt free SSL certificate virtual host example
<VirtualHost *:80>
ServerName anniballo.com
ServerAlias diego.anniballo.com www.anniballo.com
Redirect permanent / https://diego.anniballo.com/
</VirtualHost>
<VirtualHost *:443>
ServerName anniballo.com
ServerAlias diego.anniballo.com www.anniballo.com
ServerAdmin [email protected]
# [...]
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/anniballo.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/anniballo.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/anniballo.com/chain.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment