Skip to content

Commit 2e313a2

Browse files
committed
Update config files
1 parent 415b84e commit 2e313a2

22 files changed

Lines changed: 323 additions & 244 deletions

resources/modules/Apache/conf/errors.conf

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@
2222
Include "${SRVROOT}/conf/languages.conf"
2323
</Directory>
2424

25-
ErrorDocument 400 /_error_pages/400.html%{ENV:_error_lang}
26-
ErrorDocument 401 /_error_pages/401.html%{ENV:_error_lang}
27-
ErrorDocument 402 /_error_pages/402.html%{ENV:_error_lang}
28-
ErrorDocument 403 /_error_pages/403.html%{ENV:_error_lang}
29-
ErrorDocument 404 /_error_pages/404.html%{ENV:_error_lang}
30-
ErrorDocument 405 /_error_pages/405.html%{ENV:_error_lang}
31-
ErrorDocument 408 /_error_pages/408.html%{ENV:_error_lang}
32-
ErrorDocument 410 /_error_pages/410.html%{ENV:_error_lang}
33-
ErrorDocument 413 /_error_pages/413.html%{ENV:_error_lang}
34-
ErrorDocument 414 /_error_pages/414.html%{ENV:_error_lang}
35-
ErrorDocument 415 /_error_pages/415.html%{ENV:_error_lang}
36-
ErrorDocument 429 /_error_pages/429.html%{ENV:_error_lang}
37-
ErrorDocument 431 /_error_pages/431.html%{ENV:_error_lang}
38-
ErrorDocument 451 /_error_pages/451.html%{ENV:_error_lang}
39-
ErrorDocument 500 /_error_pages/500.html%{ENV:_error_lang}
40-
ErrorDocument 501 /_error_pages/501.html%{ENV:_error_lang}
41-
ErrorDocument 502 /_error_pages/502.html%{ENV:_error_lang}
42-
ErrorDocument 503 /_error_pages/503.html%{ENV:_error_lang}
43-
ErrorDocument 504 /_error_pages/504.html%{ENV:_error_lang}
25+
ErrorDocument 400 /_error_pages/400.html
26+
ErrorDocument 401 /_error_pages/401.html
27+
ErrorDocument 402 /_error_pages/402.html
28+
ErrorDocument 403 /_error_pages/403.html
29+
ErrorDocument 404 /_error_pages/404.html
30+
ErrorDocument 405 /_error_pages/405.html
31+
ErrorDocument 408 /_error_pages/408.html
32+
ErrorDocument 410 /_error_pages/410.html
33+
ErrorDocument 413 /_error_pages/413.html
34+
ErrorDocument 414 /_error_pages/414.html
35+
ErrorDocument 415 /_error_pages/415.html
36+
ErrorDocument 429 /_error_pages/429.html
37+
ErrorDocument 431 /_error_pages/431.html
38+
ErrorDocument 451 /_error_pages/451.html
39+
ErrorDocument 500 /_error_pages/500.html
40+
ErrorDocument 501 /_error_pages/501.html
41+
ErrorDocument 502 /_error_pages/502.html
42+
ErrorDocument 503 /_error_pages/503.html
43+
ErrorDocument 504 /_error_pages/504.html
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Block access to hidden files and folders except .well-known
2+
3+
<FilesMatch "^\.((?!well-known/).)*$">
4+
Require all denied
5+
</FilesMatch>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Block access to backup, config, command, and log files
2+
3+
<FilesMatch "\.(bak|conf|config|cnf|ini|inc|log|sh|sql|tar|tgz)$|~$">
4+
Require all denied
5+
</FilesMatch>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# ======================================================================
2+
# Dynamic compression only: Brotli + Deflate by Content-Type
3+
# Correct headers (Vary)
4+
#
5+
# Requires: mod_filter; mod_headers; plus mod_brotli and/or mod_deflate
6+
# ======================================================================
7+
8+
<IfModule mod_filter.c>
9+
10+
<IfModule mod_brotli.c>
11+
BrotliCompressionQuality 3
12+
AddOutputFilterByType BROTLI_COMPRESS \
13+
text/html \
14+
text/css \
15+
text/plain \
16+
text/csv \
17+
text/markdown \
18+
text/calendar \
19+
text/vcard \
20+
text/vtt \
21+
text/cache-manifest \
22+
text/javascript \
23+
text/x-component \
24+
application/javascript \
25+
application/json \
26+
application/ld+json \
27+
application/schema+json \
28+
application/geo+json \
29+
application/xml \
30+
application/rdf+xml \
31+
application/rss+xml \
32+
application/atom+xml \
33+
application/xhtml+xml \
34+
application/xslt+xml \
35+
application/manifest+json \
36+
application/x-web-app-manifest+json \
37+
application/rtf \
38+
application/x-x509-ca-cert \
39+
application/wasm \
40+
image/svg+xml \
41+
application/vnd.ms-fontobject \
42+
font/ttf \
43+
font/collection \
44+
font/otf
45+
</IfModule>
46+
47+
<IfModule mod_deflate.c>
48+
DeflateCompressionLevel 3
49+
AddOutputFilterByType DEFLATE \
50+
text/html \
51+
text/css \
52+
text/plain \
53+
text/csv \
54+
text/markdown \
55+
text/calendar \
56+
text/vcard \
57+
text/vtt \
58+
text/cache-manifest \
59+
text/javascript \
60+
text/x-component \
61+
application/javascript \
62+
application/json \
63+
application/ld+json \
64+
application/schema+json \
65+
application/geo+json \
66+
application/xml \
67+
application/rdf+xml \
68+
application/rss+xml \
69+
application/atom+xml \
70+
application/xhtml+xml \
71+
application/xslt+xml \
72+
application/manifest+json \
73+
application/x-web-app-manifest+json \
74+
application/rtf \
75+
application/x-x509-ca-cert \
76+
application/wasm \
77+
image/svg+xml \
78+
application/vnd.ms-fontobject \
79+
font/ttf \
80+
font/collection \
81+
font/otf
82+
</IfModule>
83+
84+
</IfModule>
85+
86+
<IfModule mod_headers.c>
87+
<FilesMatch "\.(html?|css|js|mjs|json|xml|svg|txt|csv|map|webmanifest|vtt|wasm|eot|ttf|otf)$">
88+
Header merge Vary Accept-Encoding
89+
</FilesMatch>
90+
</IfModule>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<If "%{HTTPS} == 'off' && %{HTTP:X-Forwarded-Proto} !~ /(^|,\s*)https($|,\s*)/ && %{QUERY_STRING} != ''">
2+
Redirect 301 / https://0.0.0.0/
3+
Header always set Location "expr=https://%{HTTP_HOST}%{REQUEST_URI}?%{QUERY_STRING}"
4+
</If>
5+
6+
<If "%{HTTPS} == 'off' && %{HTTP:X-Forwarded-Proto} !~ /(^|,\s*)https($|,\s*)/ && %{QUERY_STRING} == ''">
7+
Redirect 301 / https://0.0.0.0/
8+
Header always set Location "expr=https://%{HTTP_HOST}%{REQUEST_URI}"
9+
</If>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Requires:
2+
# mod_alias
3+
# mod_headers
4+
5+
<If "%{HTTP_HOST} =~ m#(?i)^www\.# && ( %{HTTP:X-Forwarded-Proto} =~ /(^|,\s*)https($|,\s*)/ || (%{HTTPS} == 'on' && %{HTTP:X-Forwarded-Proto} == '') ) && %{QUERY_STRING} != ''">
6+
Redirect permanent / http://0.0.0.0/
7+
Header always set Location "expr='https://' + replace(%{req:Host}, '(?i)^www\.', '') + %{REQUEST_URI} + '?' + %{QUERY_STRING}"
8+
</If>
9+
10+
<If "%{HTTP_HOST} =~ m#(?i)^www\.# && ( %{HTTP:X-Forwarded-Proto} =~ /(^|,\s*)https($|,\s*)/ || (%{HTTPS} == 'on' && %{HTTP:X-Forwarded-Proto} == '') ) && %{QUERY_STRING} == ''">
11+
Redirect permanent / http://0.0.0.0/
12+
Header always set Location "expr='https://' + replace(%{req:Host}, '(?i)^www\.', '') + %{REQUEST_URI}"
13+
</If>
14+
15+
<If "%{HTTP_HOST} =~ m#(?i)^www\.# && !( %{HTTP:X-Forwarded-Proto} =~ /(^|,\s*)https($|,\s*)/ || (%{HTTPS} == 'on' && %{HTTP:X-Forwarded-Proto} == '') ) && %{QUERY_STRING} != ''">
16+
Redirect permanent / http://0.0.0.0/
17+
Header always set Location "expr='http://' + replace(%{req:Host}, '(?i)^www\.', '') + %{REQUEST_URI} + '?' + %{QUERY_STRING}"
18+
</If>
19+
20+
<If "%{HTTP_HOST} =~ m#(?i)^www\.# && !( %{HTTP:X-Forwarded-Proto} =~ /(^|,\s*)https($|,\s*)/ || (%{HTTPS} == 'on' && %{HTTP:X-Forwarded-Proto} == '') ) && %{QUERY_STRING} == ''">
21+
Redirect permanent / http://0.0.0.0/
22+
Header always set Location "expr='http://' + replace(%{req:Host}, '(?i)^www\.', '') + %{REQUEST_URI}"
23+
</If>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Disable logs for favicon.ico and robots.txt
2+
3+
<FilesMatch "^(favicon\.ico|robots\.txt)$">
4+
SetEnv dontlog 1
5+
</FilesMatch>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<FilesMatch "\.(svg|png|jpe?g|gif|webp|avif|jxl|ico|tiff?|heic|css|js|mjs|map|webmanifest|wasm|json|jsonld|geojson|xml|txt|csv|pdf|eot|otf|ttf|ttc|woff2?|mp4|mov|webm|mpe?g|avi|ogv|mp3|wav|ogg|m4a|aac|mid|midi)$">
2+
# Only for PROD environments
3+
# Header always set Cache-Control "public, max-age=3600, must-revalidate"
4+
# Only if ?v= is used for versioning
5+
# Header always set Cache-Control "public, max-age=31536000, immutable"
6+
# Only for DEV environments
7+
Header always set Cache-Control "max-age=0, must-revalidate"
8+
</FilesMatch>

0 commit comments

Comments
 (0)