HAProxy Enterprise Documentation 2.1r1
You can reject a TCP connection or HTTP request by using one of the following directives in a
Closes the connection without a response after a session has been created and the HTTP parser has been initialized. Use this if you need to evaluate the request's Layer 7 attributes (HTTP headers, cookies, URL).
tcp-request content reject
Closes the connection without a response once a session has been created, but before the HTTP parser has been initialized. These requests still show in your logs.
tcp-request connection reject
Closes the connection without a response at the earliest point, before a session has been created. These requests do not show in your logs.
A reject response closes the connection immediately without sending a response. The client's browser will display a "The connection was reset" error page.
In the following example, we reject requests originating from IP addresses we wish to block:
acl blocked_ip src -f /etc/hapee-2.1/blocklist.acl
tcp-request connection reject if blocked_ip
Next up Single Sign-on