mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-12 01:56:58 +02:00
At the very beginning of haproxy, there was "option httpclose" to make haproxy add a "Connection: close" header in both directions to invite both sides to agree on closing the connection. It did not work with some rare products, so "option forceclose" was added to do the same and actively close the connection. Then client-side keep-alive was supported, so option http-server-close was introduced. Now we have keep-alive with a fourth option, not to mention the implicit tunnel mode. The connection configuration has become a total mess because all the options above may be combined together, despite almost everyone thinking they cancel each other, as judging from the common problem reports on the mailing list. Unfortunately, re-reading the doc shows that it's not clear at all that options may be combined, and the opposite seems more obvious since they're compared. The most common issue is options being set in the defaults section that are not negated in other sections, but are just combined when the user expects them to be overloaded. The migration to keep-alive by default will only make things worse. So let's start to address the first problem. A transaction can only work in 5 modes today : - tunnel : haproxy doesn't bother with what follows the first req/resp - passive close : option http-close - forced close : option forceclose - server close : option http-server-close with keep-alive on the client side - keep-alive : option http-keep-alive, end to end All 16 combination for each section fall into one of these cases. Same for the 256 combinations resulting from frontend+backend different modes. With this patch, we're doing something slightly different, which will not change anything for users with valid configs, and will only change the behaviour for users with unsafe configs. The principle is that these options may not combined anymore, and that the latest one always overrides all the other ones, including those inherited from the defaults section. The "no option xxx" statement is still supported to cancel one option and fall back to the default one. It is mainly needed to ignore defaults sections (eg: force the tunnel mode). The frontend+backend combinations have not changed. So for examplen the following configuration used to put the connection into forceclose : defaults http mode http option httpclose frontend foo. option http-server-close => http-server-close+httpclose = forceclose before this patch! Now the frontend's config replaces the defaults config and results in the more expected http-server-close. All 25 combinations of the 5 modes in (frontend,backend) have been successfully tested. In order to prepare for upcoming changes, a new "option http-tunnel" was added. It currently only voids all other options, and has the lowest precedence when mixed with another option in another frontend/backend. |
||
---|---|---|
.. | ||
acl.h | ||
arg.h | ||
auth.h | ||
backend.h | ||
capture.h | ||
channel.h | ||
checks.h | ||
compression.h | ||
connection.h | ||
counters.h | ||
fd.h | ||
freq_ctr.h | ||
global.h | ||
hdr_idx.h | ||
lb_chash.h | ||
lb_fas.h | ||
lb_fwlc.h | ||
lb_fwrr.h | ||
lb_map.h | ||
listener.h | ||
log.h | ||
map.h | ||
obj_type.h | ||
pattern.h | ||
peers.h | ||
pipe.h | ||
port_range.h | ||
proto_http.h | ||
proto_tcp.h | ||
protocol.h | ||
proxy.h | ||
queue.h | ||
sample.h | ||
server.h | ||
session.h | ||
signal.h | ||
ssl_sock.h | ||
stick_table.h | ||
stream_interface.h | ||
task.h | ||
template.h |