Hello list. I'm trying to send a HTTP 413 to the user based on the 
hdr(Content-Length). What I've tried so far:

1. Create a http413 backend only with `errorfile 400` + `http-request 
deny_status 400`. In the frontend, configure a `use_backend http413 if 
<need-413>`. This is my current approach but it is wasting some time in the 
frontend for every single request of every single backend - we have about 1000 
backends and only about 10% need to check Content Length - btw distinct content 
lengths.

2. Use the `errorfile 400` approach in the same backend that does the load 
balance. This doesn't sound good because I'm overwriting some internal response 
code and its payload. Btw, what if I need another 2, 3, 10 http response codes?

3. Use some creativity eg: errorfile 413 + deny_status 413; use_backend inside 
another backend; what more? The later doesn't make sense but the former is a 
pitty that isn't supported.

Is there another way to deny a http request with a custom status and html 
content that I’m missing? Thanks!

~jm


Reply via email to