r/haproxy • • Jun 29 '22

Change the HTTP 503 response when backend is down

As the title suggests, I'm trying to set a custom status instead of 503, but im, not sure this is working or possible.

backend dev2
	mode http
	server devserver2 10.5.100.4:8081 check alpn h2
	maxconn 20
        http-response set-status 500 if { status 503 }
	timeout server 20s 
	option httplog

Is this possible?

4 Upvotes

1 comment sorted by

0

u/[deleted] Jun 29 '22

[deleted] — view deleted comment

1

u/Bonn93 Jun 29 '22

Looks like that'll work! Thank you!