Search code examples
cgilighttpd

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.


Solution

    • server.stream-request-body = 0 (default) buffer entire request body before connecting to backend

    • server.stream-request-body = 1 stream request body to backend; buffer to temp files

    • server.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