Created
February 5, 2020 15:30
-
-
Save GeorgeGedox/2a0e32653a3fabb562e5ca191007db95 to your computer and use it in GitHub Desktop.
Laravel Virtual Host example for Apache containing SSL support and HTTP to HTTPS redirect
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
<VirtualHost *:80> | |
ServerName example.com | |
ServerAlias www.example.com | |
ErrorLog ${APACHE_LOG_DIR}/example.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined | |
RewriteEngine on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] | |
</VirtualHost> | |
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
ServerName example.com | |
ServerAlias www.example.com | |
ErrorLog ${APACHE_LOG_DIR}/example.com-error.log | |
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined | |
Protocols h2 http/1.1 | |
DocumentRoot /var/www/example.com/public/ | |
<Directory "/var/www/example.com/public/"> | |
Options +Includes | |
Options +FollowSymLinks -Indexes | |
AllowOverride All | |
Require all granted | |
</Directory> | |
SSLEngine on | |
SSLProtocol all -SSLv2 -SSLv3 | |
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS | |
SSLHonorCipherOrder on | |
SSLCompression off | |
SSLOptions +StrictRequire | |
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 | |
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem | |
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem | |
</VirtualHost> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment