mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
/cdn-cgi/trace test
This commit is contained in:
@ -20,6 +20,7 @@ services:
|
||||
- ./haproxy/backends.map:/etc/haproxy/backends.map
|
||||
- ./haproxy/blocked.map:/etc/haproxy/blocked.map
|
||||
- ./haproxy/dataplaneapi.hcl:/etc/haproxy/dataplaneapi.hcl
|
||||
- ./haproxy/trace.html:/etc/haproxy/trace.html
|
||||
- ./src/scripts/:/etc/haproxy/scripts/
|
||||
- ./src/libs/:/etc/haproxy/libs/
|
||||
- ./haproxy/js/:/var/www/js/
|
||||
@ -28,7 +29,7 @@ services:
|
||||
- HCAPTCHA_SITEKEY=
|
||||
- CAPTCHA_COOKIE_SECRET=
|
||||
- POW_COOKIE_SECRET=
|
||||
- RAY_ID=
|
||||
- RAY_ID=docker
|
||||
- BUCKET_DURATION=43200
|
||||
- BACKEND_NAME=servers
|
||||
- SERVER_PREFIX=websrv
|
||||
|
@ -22,6 +22,8 @@ frontend http-in
|
||||
acl is_existing_vhost hdr(host),lower,map_str(/etc/haproxy/hosts.map) -m found
|
||||
http-request silent-drop unless is_existing_vhost
|
||||
|
||||
http-request return status 200 content-type "text/html; charset=utf-8" lf-file /etc/haproxy/trace.html if { path /cdn-cgi/trace }
|
||||
|
||||
# acl for blocked IPs/subnets
|
||||
acl blocked_ip_or_subnet src,map_ip(/etc/haproxy/blocked.map) -m found
|
||||
http-request deny deny_status 403 if blocked_ip_or_subnet
|
||||
|
21
haproxy/trace.html
Normal file
21
haproxy/trace.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>trace</title>
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
ts=%Ts
|
||||
h=%[hdr(host)]
|
||||
ip=%ci
|
||||
uag=%[hdr(user-agent)]
|
||||
http=%HV
|
||||
tls=%[ssl_fc]
|
||||
tlsv=%sslv
|
||||
sni=%[ssl_fc_sni]
|
||||
vey_id=%[env(RAY_ID)]
|
||||
bucket=%[env(BUCKET_DURATION)]
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user