Process large headers ranging from 8Kb to 1Mb on haproxy using tune.bufsize and tune.maxrewrite

I am currently doing a POC on haproxy.
Haproxy gives the TR time which is time required to receive the first byte of header to last byte of header.
I want to use this TR time for my purpose.
Currently I have set following values in global section

tune.bufsize 131702
tune.maxrewrite 32768

But I am getting
400 Bad Request
Request Header Or Cookie Too Large

I understand header should not be large but in this case I need to check by sending large header

@lukastribus Please share your thoughts

If you have a header of 1MB then haproxy will not be able to help you.

If you have a decent sized header that based on the tune.bufsize and tune.maxrewrite documentation should theoretically pass but does not, then you will have to share full header length and header line length.

It is working now. My request was going to nginx and that’s why it was rejected from nginx