26 lines
No EOL
844 B
ApacheConf
26 lines
No EOL
844 B
ApacheConf
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
RewriteCond %{SERVER_PORT} 80
|
|
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
|
</IfModule>
|
|
|
|
# compress text file responses
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/plain
|
|
AddOutputFilterByType DEFLATE text/html
|
|
AddOutputFilterByType DEFLATE text/css
|
|
AddOutputFilterByType DEFLATE text/javascript
|
|
AddOutputFilterByType DEFLATE application/json
|
|
AddOutputFilterByType DEFLATE application/javascript
|
|
AddOutputFilterByType DEFLATE application/x-javascript
|
|
</IfModule>
|
|
|
|
# set security headers in all responses
|
|
<IfModule mod_headers.c>
|
|
|
|
# serve files as plain text if the actual content type is not known
|
|
# (hardens against attacks from malicious file uploads)
|
|
Header set Content-Type "text/plain" "expr=-z %{CONTENT_TYPE}"
|
|
Header set X-Content-Type-Options "nosniff"
|
|
|
|
</IfModule> |