I have copied some code from mod_fastcgi.c in to mod_scgi.c to allow the X-Sendfile header to work. Since I know nothing about lighttpd internals this is just a shot in the dark, but it does seem to send the correct data to my browser.
One issue I've discovered is that if the file lookup with stat_cache_get_entry fails, the server sends an empty file, not a 502 error code as intended.
Anyway this is a start. If someone familiar with lighttpd/scgi would like to give feedback I'd be happy to revise the patch as needed.
diffs against lighttpd-1.4.27
[mod_cgi,mod_fastcgi,mod_scgi] X-Sendfile features
[core] http_response_send_file() shared code (#2017)
[mod_fastcgi] use http_response_xsendfile()
(fixes #799, fixes #851, fixes #2017, fixes #2076)
[mod_scgi] X-Sendfile feature (fixes #2253)
[mod_cgi] X-Sendfile feature (fixes #2313)
Merge branch 'feature-2017-http_response_send_file' into master
github: closes #59
Updated by radzio over 7 years ago
Also available in: Atom