Haproxy tarpit requests with different status code

Hello,

As per the documentation https://cbonte.github.io/haproxy-dconv/1.9/configuration.html#4.2-http-request%20tarpit, i tried this

http-request tarpit deny_status 450 if /abc/dev 

I was expected tarpitted request with status code 450 (Custom http code) but it’s still returning 500 (default value), Am i missing any extra param/argument in my config line? My haproxy version is haproxy 1.9.4

Hi,

you can only deny_status with one of the codes that haproxy can emit. the list is available in the documentation for errorfile https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#errorfile .

if you want to return a 450, you’ll have to use errorfile as well, ie:

	http-request tarpit deny_status 429
	errorfile 429 /tmp/foo

and /tmp/foo contains

HTTP/1.1 450 something

some content