Lighttpd + x-send-file
Added by pengc99 almost 16 years ago
Hello all, I've run into a bit of trouble with mod_fastcgi and the x-send-file system. I have an authenticated download system that used to be running with mod_rewrite and an external rewrite program written in perl. However, I believed I could get more performance out of it by switching it over to lighttpd since only static files were sent, so my search ended up here.
I want to use the x-send-file header in a php script to control access to a file. I can do the header setup in PHP no problem; thats the easy part. However, I'm trying to get the server-side of it working, and it seems to be rather poorly documented.
Since my host doesn't have mod_proxy_code installed I can't use that version. The server version is:
lighttpd-1.4.22 (ssl) (Apr 15 2009 10:52:13) - a light and fast webserver
This might sound stupid, but is this greater than or less than version 1.4.4?
All I need is for the server to internally redirect and send the specified file when it is inserted with x-send-file in the header. However, the it seems like the current implementation of x-send-file requires another application server as mod_fastcgi is based on forwarding requests to another host. Is there a way to do it purely internally with lighttpd so no external programs are required? For example, i'm expecting x-send-file to simply internally redirect to the file instead of going through an external application specified with host and port in the fastcgi configuration.
Replies (2)
RE: Lighttpd + x-send-file - Added by nitrox almost 16 years ago
this has it all, not much more needed.
RE: Lighttpd + x-send-file - Added by pengc99 almost 16 years ago
I've tried that method, and using his config file does not work, it throws errors about the brackets. If I replace the brackets with (), it still throws errors. See in his configuration he is still forwarding requests to 192.168.0.1:
fastcgi.server = { ".php" => { "192.168.0.1" => { # .... "allow-x-send-file" => "enable" } } }
I will give it a try again though, thank you.