X-accel-redirect serving html download page instead of file.

wideawake nginx-forum at nginx.us
Tue Aug 28 03:02:33 UTC 2012


I noticed that if I use this in my config then shipped/Dir 1/file.exe
returns file not found in browser and shipped/dir/file.exe still returns
proper file extension (exe, etc) but contains the html content of the
download page.

location = /files {
root /home/mysite/public_html/shipped;
internal;
add_header Content-Disposition attachment;
}

header("X-Accel-Redirect: /files/" . $path);

While removing that and using "header("X-Accel-Redirect: /shipped/" .
$path);" the actual file location works for shipped/Dir 1/file.exe but not
for shipped/dir/file.exe.

I'm at a lose as to why it's not working properly.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,230161,230165#msg-230165



More information about the nginx mailing list