mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
28 lines
809 B
INI
28 lines
809 B
INI
global
|
|
daemon
|
|
maxconn 256
|
|
log stdout format raw local0 debug
|
|
lua-load /usr/local/etc/haproxy/scripts/register.lua
|
|
|
|
defaults
|
|
mode http
|
|
timeout connect 5000ms
|
|
timeout client 50000ms
|
|
timeout server 50000ms
|
|
|
|
frontend http-in
|
|
bind *:80
|
|
default_backend servers
|
|
|
|
http-request lua.hcaptcha-redirect if !{ path -m beg /captcha }
|
|
http-request use-service lua.hello-world if { path /hello_world }
|
|
http-request use-service lua.hcaptcha-view if { path /captcha/ }
|
|
http-request use-service lua.ratelimit if { path /test }
|
|
|
|
acl captcha_passed var(txn.captcha_passed) -m bool
|
|
acl on_captcha_url path -m beg /captcha
|
|
redirect prefix /captcha code 301 if !captcha_passed !on_captcha_url
|
|
|
|
backend servers
|
|
server server1 nginx:80 maxconn 32
|