Enable strict transport security

This commit is contained in:
Salt 2020-02-06 03:22:38 -06:00
parent 67373adcaf
commit cffd0b38bb

View File

@ -9,15 +9,7 @@ SSLStrictSNIVHostCheck off
# Website configuration # Website configuration
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ nextcloud_url }} ServerName {{ nextcloud_url }}
# Uncomment me for HTTPS redirection Redirect permanent / https://{{ nextcloud_url }}
# Leaving it off for now for testing
#Redirect permanent / https://{{ nextcloud_url }}
DocumentRoot {{ nextcloud_webroot }}
<Directory "{{ nextcloud_webroot }}">
Require all granted
AllowOverride All
Options MultiViews FollowSymlinks
</Directory>
</VirtualHost> </VirtualHost>
<VirtualHost *:443> <VirtualHost *:443>
SSLEngine on SSLEngine on
@ -36,4 +28,7 @@ SSLStrictSNIVHostCheck off
AllowOverride All AllowOverride All
Options MultiViews FollowSymlinks Options MultiViews FollowSymlinks
</Directory> </Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
</VirtualHost> </VirtualHost>