問題描述
lighttpd:禁用 CGI 緩衝 (lighttpd: disable CGI buffering)
Is there a way to stop lighttpd from buffering POSTs to a CGI executable?
It seems to me that all requests are fully buffered on disk before they are forwarded to the CGI executable, which makes it impossible for me to process the input in a stream‑based way.
To clarify, I'm only talking about the request that is forwarded to the CGI executable on the standard input; I've already verified that the response is not buffered like that, and streaming output is indeed possible.
‑‑‑‑‑
參考解法
方法 1:
server.stream‑request‑body = 0 (default)
buffer entire request body before connecting to backendserver.stream‑request‑body = 1
stream request body to backend; buffer to temp filesserver.stream‑request‑body = 2
stream request body to backend; minimal buffering might block upload
when using HTTPS, it is recommended to additionally set ssl.read‑ahead = "disable"
https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream‑request‑bodyDetails
(by lxgr、Tamás Zahola)