Willy Tarreau | 8263b91 | 2011-09-05 01:04:44 +0200 | [diff] [blame] | 1 | 2011/04/20 - List of keep-alive / close options with associated behaviours. |
| 2 | |
| 3 | PK="http-pretend-keepalive", HC="httpclose", SC="http-server-close", |
| 4 | FC = "forceclose". |
| 5 | |
| 6 | 0 = option not set |
| 7 | 1 = option is set |
| 8 | * = option doesn't matter |
| 9 | |
| 10 | Options can be split between frontend and backend, so some of them might have |
| 11 | a meaning only when combined by associating a frontend to a backend. Some forms |
| 12 | are not the normal ones and provide a behaviour compatible with another normal |
Joseph Herlant | 71b4b15 | 2018-11-13 16:55:16 -0800 | [diff] [blame] | 13 | form. Those are considered alternate forms and are marked "(alt)". |
Willy Tarreau | 8263b91 | 2011-09-05 01:04:44 +0200 | [diff] [blame] | 14 | |
| 15 | FC SC HC PK Behaviour |
| 16 | 0 0 0 X tunnel mode |
| 17 | 0 0 1 0 passive close, only set headers then tunnel |
| 18 | 0 0 1 1 forced close with keep-alive announce (alt) |
| 19 | 0 1 0 0 server close |
| 20 | 0 1 0 1 server close with keep-alive announce |
| 21 | 0 1 1 0 forced close (alt) |
| 22 | 0 1 1 1 forced close with keep-alive announce (alt) |
| 23 | 1 * * 0 forced close |
| 24 | 1 * * 1 forced close with keep-alive announce |
| 25 | |
| 26 | At this point this results in 4 distinct effective modes for a request being |
| 27 | processed : |
| 28 | - tunnel mode : Connection header is left untouched and body is ignored |
| 29 | - passive close : Connection header is changed and body is ignored |
| 30 | - server close : Connection header set, body scanned, client-side keep-alive |
| 31 | is made possible regardless of server-side capabilities |
| 32 | - forced close : Connection header set, body scanned, connection closed. |
| 33 | |
| 34 | The "close" modes may be combined with a fake keep-alive announce to the server |
| 35 | in order to workaround buggy servers that disable chunked encoding and content |
| 36 | length announces when the client does not ask for keep-alive. |
| 37 | |
| 38 | Note: "http-pretend-keepalive" alone has no effect. However, if it is set in a |
| 39 | backend while a frontend is in "http-close" mode, then the combination of |
| 40 | both will result in a forced close with keep-alive announces for requests |
| 41 | passing through both. |
| 42 | |
| 43 | It is also worth noting that "option httpclose" alone has become useless since |
| 44 | 1.4, because "option forceclose" does the right thing, while the former only |
| 45 | pretends to do the right thing. Both options might get merged in the future. |
| 46 | |