Private
Public Access
2
0

add comments, add *_add and *_del variables, add active and passive checks, change geoip2 db dir

This commit is contained in:
2026-02-04 12:29:56 +03:00
parent 34e401784b
commit 34f208b75b
7 changed files with 161 additions and 93 deletions

View File

@@ -5,13 +5,15 @@ caddy_global_sites_defaults:
site_aliases: []
site_redirect_from_aliases: true
# Log settings
# If log_to_file is true, logs will go:
# - for each site, in: /var/log/<caddy_my_name>/site_<site id>.log
# - for WAF logs (Coraza), in /var/log/<caddy_my_name>/waf.log
log_to_file: false
log_format: "json"
# Proxy settings
# See: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#lb_policy
proxy_lb_policy: "ip_hash" # random
# random_choose <n>
# first
@@ -24,28 +26,51 @@ caddy_global_sites_defaults:
# query [key]
# header [field]
# cookie [<name> [<secret>]]
# Upstreams active checks
# See: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#active-health-checks
proxy_active_checks: false
proxy_active_checks_uri: "/"
proxy_active_checks_port: 80
proxy_active_checks_interval: "30s"
proxy_active_checks_timeout: "5s"
proxy_active_checks_method: "GET"
proxy_active_checks_status: "2xx"
proxy_active_checks_body: null
# Upstreams passive checks
# See: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#passive-health-checks
proxy_passive_checks: false
proxy_passive_checks_fail_duration: "30s"
proxy_passive_checks_max_fails: 1
proxy_passive_checks_unhealthy_status: "5xx"
proxy_passive_checks_unhealthy_latency: "2000ms"
proxy_passive_checks_unhealthy_request_count: null
# Filters
filter_blacklist: [] # Superseeds filter_whitelist
filter_blacklist: [] # Superseeds filter_whitelist
filter_whitelist: ["127.0.0.1"]
# Custom TLS certificate
custom_cert: false
custom_cert_file: ""
custom_cert_key_file: ""
custom_cert_file: null # Mandatory if custum_cert is true
custom_cert_key_file: null # Mandatory if custum_cert is true
# CORS - Cross Origin Resource Sharing
cors: false
cors_allow_origins: null # Mandatory
cors_allow_origins: [] # Minimum 1 required
cors_allow_methods:
# These variables can be used for adding and removing extensions from the list:
# cors_allow_methods_add: ["XXX"]
# cors_allow_methods_del: ["YYY"]
- "GET"
- "HEAD"
- "POST"
- "OPTIONS"
cors_allow_headers:
# These variables can be used for adding and removing extensions from the list:
# cors_allow_headers_add: ["Xxx"]
# cors_allow_headers_del: ["Yyy"]
- "Cache-Control"
- "Content-Type"
- "If-Modified-Since"
@@ -54,8 +79,14 @@ caddy_global_sites_defaults:
cors_max_age: 3600
cors_allow_credentials: false
cors_vary:
# These variables can be used for adding and removing extensions from the list:
# cors_vary_add: ["Xxx"]
# cors_vary_del: ["Yyy"]
- "Origin"
cors_expose_headers:
# These variables can be used for adding and removing extensions from the list:
# cors_expose_headers_add: ["Xxx"]
# cors_expose_headers_del: ["Yyy"]
- "Content-Length"
- "Content-Range"
@@ -240,20 +271,17 @@ caddy_global_sites_defaults:
- name: "X-BYOW"
value: "🍷"
# caddy-ratelimit
rate_limit: true
rate_limit_events: 1000
rate_limit_window: "1m"
# steffenbusch/caddy-bot-barrier
bot_barrier: false
bot_barrier_secret: null # Required
bot_barrier_complexity: 18
bot_barrier_valid_for: "60m"
# corazawaf/coraza-caddy
crs: true
crs_version: "4.22.0"
@@ -262,7 +290,7 @@ caddy_global_sites_defaults:
crs_exceptions:
before_request: []
after_response: []
crs_paranoia_level: 1
crs_paranoia_level: 4
crs_detection_paranoia_level: null
crs_enforce_bodyproc_urlencoded: 1
crs_critical_anomaly_score: 5
@@ -280,11 +308,17 @@ caddy_global_sites_defaults:
crs_combined_file_sizes: 20970520 # 20 Mo
crs_sampling_percentage: 100
crs_allowed_methods:
# These variables can be used for adding and removing extensions from the list:
# crs_allowed_methods_add: ["XXX"]
# crs_allowed_methods_del: ["YYY"]
- "GET"
- "HEAD"
- "POST"
- "OPTIONS"
crs_allowed_request_content_type:
# These variables can be used for adding and removing extensions from the list:
# crs_allowed_request_content_type_add: ["|xxx/yyy|"]
# crs_allowed_request_content_type_del: ["|zzz/aaa|"]
- "|application/csp-report|"
- "|application/json|"
- "|application/reports+json|"
@@ -294,6 +328,9 @@ caddy_global_sites_defaults:
- "|multipart/form-data|"
- "|text/xml|"
crs_restricted_extensions:
# These variables can be used for adding and removing extensions from the list:
# crs_restricted_extensions_add: [".xxx/"]
# crs_restricted_extensions_del: [".yyy/"]
- ".ani/"
- ".asa/"
- ".asax/"
@@ -388,6 +425,9 @@ caddy_global_sites_defaults:
- ".xsd/"
- ".xsx/"
crs_restricted_headers_basic:
# These variables can be used for adding and removing extensions from the list:
# crs_restricted_headers_basic_add: ["/xxx/"]
# crs_restricted_headers_basic_del: ["/yyy/"]
- "/content-encoding/"
- "/content-range/"
- "/expect/"
@@ -399,8 +439,14 @@ caddy_global_sites_defaults:
- "/x-method-override/"
- "/x-middleware-subrequest/"
crs_restricted_headers_extended:
# These variables can be used for adding and removing extensions from the list:
# crs_restricted_headers_extended_add: ["/xxx/"]
# crs_restricted_headers_extended_del: ["/yyy/"]
- "/accept-charset/"
crs_allowed_http_versions:
# These variables can be used for adding and removing extensions from the list:
# crs_allowed_http_versions_add: ["HTTP/x.x"]
# crs_allowed_http_versions_del: ["HTTP/y.y"]
- "HTTP/1.0"
- "HTTP/1.1"
- "HTTP/2"
@@ -408,12 +454,14 @@ caddy_global_sites_defaults:
- "HTTP/3"
- "HTTP/3.0"
crs_allowed_request_content_type_charset:
# These variables can be used for adding and removing extensions from the list:
# crs_allowed_request_content_type_charset_add: ["|xxx|"]
# crs_allowed_request_content_type_charset_del: ["|yyy|"]
- "|utf-8|"
- "|iso-8859-1|"
- "|iso-8859-15|"
- "|windows-1252|"
# github.com/zhangjiayin/caddy-geoip2
geoip: false
geoip_debug: false