Is X-Accel-Limit-Rate supposed to work with "aio sendfile" on FreeBSD 9.0? It is not working for me.
It used to work earlier, but I noticed today that it no longer works. The only significant change I can remember making is in the http part of nginx.conf to turn on aio sendfile and give it a large read_ahead.
Relevant part of the nginx.conf file:
http {
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
aio sendfile;
read_ahead 32m;
access_log off;
fastcgi_read_timeout 200;
send_timeout 30;
keepalive_timeout 0;
server {
listen 80;
listen 7001;
location /files/ {
internal;
root /home/username;
post_action @done;
}
location @done {
internal;
rewrite ^ /donedownload.php?uri=$request_uri&sent=$body_bytes_sent;
}
}
}
then from my php app
header('Content-Encoding:');
header('Content-Type:');
header('X-Powered-By:');
header('Accept-Ranges: none');
header("X-Accel-Limit-Rate: $speedlimit");
header("Content-disposition: attachment; $userfilename");
header("X-Accel-redirect:/files/$filename");