This commit is contained in:
parent
4437538629
commit
280f4f96ee
@ -82,7 +82,7 @@ backend admin from {{ haproxy.config.namespace }}
|
|||||||
|
|
||||||
{%- macro geoip() %}
|
{%- macro geoip() %}
|
||||||
http-request set-var(txn.country) lua.country(req.src)
|
http-request set-var(txn.country) lua.country(req.src)
|
||||||
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body><p>ip: %[var(req.src)]</p><p>country: %[lua.country(req.src)]</p><p>city: %[lua.city(req.src)]<p></body></html>" if self_host path_location
|
http-request return status 200 content-type "text/html; charset=utf-8" lf-string "<html><body>ip: %[var(req.src)]<br/>country: %[lua.country(req.src)]<br/>city: %[lua.city(req.src)]</body></html>" if self_host path_location
|
||||||
acl allowed_country var(txn.country),map_str(/etc/haproxy/maps/countries,OK) OK
|
acl allowed_country var(txn.country),map_str(/etc/haproxy/maps/countries,OK) OK
|
||||||
http-response deny deny_status 451 content-type text/plain string "Denied" if !allowed_country !internal
|
http-response deny deny_status 451 content-type text/plain string "Denied" if !allowed_country !internal
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
Loading…
Reference in New Issue
Block a user