geoip: fixes
This commit is contained in:
@@ -131,47 +131,6 @@
|
||||
header geoip-organization "{geoip2.organization}"
|
||||
header geoip-ip_address "{geoip2.ip_address}"
|
||||
{% endif %}
|
||||
|
||||
# {% if site.geoip_deny_countries | default(caddy_sites_defaults.geoip_deny_countries) | length > 0 %}
|
||||
# @deny_countries {
|
||||
# maxmind_geolocation {
|
||||
# db_path "/var/lib/GeoIP/GeoLite2-Country.mmdb"
|
||||
# deny_countries {{ site.geoip_deny_countries | default(caddy_sites_defaults.geoip_deny_countries) | joint(" ") }}
|
||||
# }
|
||||
# }
|
||||
# respond @deny_countries "Access Denied" 403
|
||||
# {% endif %}
|
||||
#
|
||||
# {% if site.geoip_allow_countries | default(caddy_sites_defaults.geoip_allow_countries) | length > 0 %}
|
||||
# @not_allow_countries not {
|
||||
# maxmind_geolocation {
|
||||
# db_path "/var/lib/GeoIP/GeoLite2-Country.mmdb"
|
||||
# allow_countries {{ site.geoip_allow_countries | default(caddy_sites_defaults.geoip_allow_countries) | joint(" ") }}
|
||||
# }
|
||||
# }
|
||||
# respond @not_allow_countries "Access Denied" 403
|
||||
# {% endif %}
|
||||
#
|
||||
# {% if site.geopip_deny_asn | default(caddy_sites_defaults.geopip_deny_asn) | length > 0 %}
|
||||
# @deny_asn {
|
||||
# maxmind_geolocation {
|
||||
# db_path "/var/lib/GeoIP/GeoLite2-ASN.mmdb"
|
||||
# deny_asn {{ site.geopip_deny_asn | default(caddy_sites_defaults.geopip_deny_asn) | joint(" ") }}
|
||||
# }
|
||||
# }
|
||||
# respond @deny_asn "Access Denied" 403
|
||||
# {% endif %}
|
||||
#
|
||||
# {% if site.geopip_allow_asn | default(caddy_sites_defaults.geopip_allow_asn) | length > 0 %}
|
||||
# @not_allow_asn not {
|
||||
# maxmind_geolocation {
|
||||
# db_path "/var/lib/GeoIP/GeoLite2-ASN.mmdb"
|
||||
# allow_asn {{ site.geopip_allow_asn | default(caddy_sites_defaults.geopip_allow_asn) | joint(" ") }}
|
||||
# }
|
||||
# }
|
||||
# respond @not_allow_asn "Access Denied" 403
|
||||
# {% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
@not_whitelisted not {
|
||||
|
||||
@@ -28,8 +28,8 @@ caddy_global_sites_defaults:
|
||||
|
||||
|
||||
# Filters
|
||||
filter_whitelist: ["127.0.0.1"]
|
||||
filter_blacklist: [] # Superseeds filter_whitelist
|
||||
filter_whitelist: ["127.0.0.1"]
|
||||
|
||||
|
||||
# Security headers
|
||||
@@ -390,7 +390,7 @@ caddy_global_sites_defaults:
|
||||
# github.com/zhangjiayin/caddy-geoip2
|
||||
geoip: false
|
||||
geoip_debug: false
|
||||
geoip_filter_expression: '{geopii2.country_code == "UNK"}'
|
||||
geoip_filter_expression: '{geoip2.country_code} == "UNK"'
|
||||
# geoip_deny_countries: [] # ISO country codes (2 letters), "UNK" for unknown country
|
||||
# geoip_allow_countries: [] # ISO country codes (2 letters), "UNK" for unknown country
|
||||
# geopip_deny_asn: []
|
||||
|
||||
Reference in New Issue
Block a user