Welcome! Log In Create A New Profile

Advanced

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

December 04, 2012 09:07AM
I've correct this bug adding an expire header like :

location ^~ /protected-file/ {
expires 30s;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
gzip off;
internal;
alias /;
}

And my PHP headers are :

header("X-Accel-Redirect: /protected-file".realpath($realpath));
header("X-Accel-Buffering: yes");
header('Content-Length: '.$size);
header("Content-Type: ");
header('Content-Disposition: attachment; filename="'.$filename.'"');

Nginx MIME types are /etc/nginx/mime.conf (from normal config)
SubjectAuthorPosted

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

wideawakeAugust 27, 2012 09:29PM

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

Justin DorfmanAugust 27, 2012 09:58PM

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

wideawakeAugust 27, 2012 10:05PM

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

Justin DorfmanAugust 27, 2012 10:32PM

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

wideawakeAugust 27, 2012 11:02PM

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

Maxim DouninSeptember 03, 2012 02:32PM

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

poulphunterDecember 04, 2012 09:07AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 82
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready