-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCaddyfile
64 lines (56 loc) · 1.21 KB
/
Caddyfile
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
60
61
62
63
64
{
auto_https off
admin localhost:2019
}
:8080 {
log {
output stdout
format console
level INFO
}
handle {
header -Server
}
route {
# WAF Plugin runs on all requests first
waf {
metrics_endpoint /waf_metrics
anomaly_threshold 10
block_countries GeoLite2-Country.mmdb RU CN KP
# whitelist_countries GeoLite2-Country.mmdb US
# rate limiter
rate_limit {
requests 100
window 10s
cleanup_interval 5m
paths /api/v1/.* /admin/.* # List of individual regex patterns
match_all_paths false
}
# Tor blocking configuration
tor {
enabled true
tor_ip_blacklist_file tor_ip_blacklist.txt
update_interval 24h
retry_on_failure true
retry_interval 1h
}
rule_file rules.json
# rule_file rules/wordpress.json
ip_blacklist_file ip_blacklist.txt
dns_blacklist_file dns_blacklist.txt
log_severity info
log_json
log_path debug.json
# redact_sensitive_data
}
# Match the waf metrics endpoint specifically and stop processing
@wafmetrics path /waf_metrics
handle @wafmetrics {
# Do not respond here so it goes to the WAF plugin
}
# All other requests, respond with "Hello World"
handle {
respond "Hello world!" 200
}
}
}