This commit is contained in:
nite07 2025-03-06 10:30:50 +11:00
parent e91368ccb7
commit 96080d774b

View File

@ -21,7 +21,7 @@
header X-Forwarded-Proto {scheme} header X-Forwarded-Proto {scheme}
request_body { request_body {
max_size 10MB max_size 50MB
} }
} }
@ -36,17 +36,28 @@
} }
} }
(geoblock) { (geo_only_allow_country) {
@non_china_block { @only_allow_country_geofilter {
not { not {
maxmind_geolocation { maxmind_geolocation {
db_path "/geodb/GeoLite2-Country.mmdb" db_path "/config/geodb/GeoLite2-Country.mmdb"
allow_countries CN allow_countries {args[0]}
} }
} }
} }
respond @non_china_block "You are blocked" 403 respond @only_allow_country_geofilter "You are blocked" 403
}
(geo_not_allow_country) {
@not_allow_country_geofilter {
maxmind_geolocation {
db_path "/config/geodb/GeoLite2-Country.mmdb"
allow_countries {args[0]}
}
}
respond @not_allow_country_geofilter "You are blocked" 403
} }
:443 { :443 {
@ -54,4 +65,4 @@
respond 404 respond 404
} }
import /conf/* import /conf/*.caddyfile