-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache.conf.example
More file actions
59 lines (49 loc) · 1.88 KB
/
apache.conf.example
File metadata and controls
59 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Apache configuration for Check4Fail status page
# Place this in /etc/apache2/sites-available/status.example.com.conf
# Enable: a2ensite status.example.com
# Reload: apache2ctl configtest && systemctl reload apache2
<VirtualHost *:80>
ServerName status.example.com
ServerAdmin admin@example.com
DocumentRoot /path/to/check4fail/public_html
<Directory /path/to/check4fail/public_html>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
# Default file
DirectoryIndex index.html
</Directory>
# Security headers
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
# Prevent caching of HTML status pages (fixes Chrome auto-refresh issues)
<FilesMatch "\.html$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
# Cache static assets
<FilesMatch "\.(css|js|jpg|jpeg|png|gif|ico|svg)$">
Header set Cache-Control "public, max-age=3600"
</FilesMatch>
# Deny access to hidden files
<FilesMatch "^\.">
Require all denied
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/status.example.com.error.log
CustomLog ${APACHE_LOG_DIR}/status.example.com.access.log combined
</VirtualHost>
# HTTPS configuration (optional, requires SSL certificate)
# <VirtualHost *:443>
# ServerName status.example.com
# ServerAdmin admin@example.com
#
# DocumentRoot /path/to/check4fail/public_html
#
# SSLEngine on
# SSLCertificateFile /etc/letsencrypt/live/status.example.com/fullchain.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/status.example.com/privkey.pem
#
# # Same configuration as above
# </VirtualHost>