36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
<VirtualHost *:80>
|
|
ServerName localhost
|
|
ServerAdmin webmaster@localhost
|
|
DocumentRoot /var/www/html
|
|
|
|
RewriteEngine On
|
|
RewriteCond %{HTTPS} off
|
|
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName localhost
|
|
ServerAdmin webmaster@localhost
|
|
DocumentRoot /var/www/html
|
|
|
|
SSLEngine on
|
|
SSLCertificateFile /etc/apache2/ssl/server.crt
|
|
SSLCertificateKeyFile /etc/apache2/ssl/server.key
|
|
|
|
<Directory /var/www/html>
|
|
Options -Indexes +FollowSymLinks
|
|
AllowOverride All
|
|
Require all granted
|
|
</Directory>
|
|
|
|
# Security headers (now working)
|
|
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
|
|
Header always set X-Content-Type-Options "nosniff"
|
|
Header always set X-Frame-Options "SAMEORIGIN"
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/ssl-error.log
|
|
CustomLog ${APACHE_LOG_DIR}/ssl-access.log combined
|
|
</VirtualHost> |