Hi, All. One customer is experiencing "502 Bad Gateway" error when Apache web server responses with lots(over 100) of "Set-Cookie" Header and found that following limitation in the default configuration of haproxy.
Environment is L7 haproxy ==> nginx reverse proxy ==> Apache web server as HTTP origin. tune.http.maxhdr <number> Sets the maximum number of headers in a request. When a request comes with a number of headers greater than this value (including the first line), it is rejected with a "400 Bad Request" status code. Similarly, too large responses are blocked with "502 Bad Gateway". The default value is 101, which is enough for all usages, considering that the widely deployed Apache server uses the same limit. as it's hard to fix customer's application immediately, we would like to setup this value such as 500 as temporary solution. Questions. 1. what's the side effect if we set this value? eats more memory? haproxy is 16GB currently. 2. As I know, default Apache configuration has no limitation for the Number of Headers. per my testing, just 8KB for the header size.(seems no limitation) Is it correct that Apache has same limit 101 as max header numbers? Please advise. Thanks