Answer the question
In order to leave comments, you need to log in
Correct paths for header('X-Accel-Redirect:?
Hello, the question is why when I send the header
header("X-Accel-Redirect: $filename");
The $filename variable is equal to "/usr/home/www/site.ru/uload/file/id/name.rar"
That is, the path is correct and everything is in order, but we get an error on the pages, go to nginx.log and see this path
/usr/home/www/site.ru/usr/home/www/site.ru/uload/file/id/name.rar
location /download {
internal;
}
Answer the question
In order to leave comments, you need to log in
You must pass a URI
to the X-Accel-Redirect header
Example:
Nginx has a location:
location /download {
internal;
}
In general, the issue was resolved, I didn’t do the location at all, I registered the file name in PHP, the root was taken from ROOT in nginx
header("X-Accel-Redirect: $filepath);
As a result, the correct path turned out, for a number of reasons and unwillingness to change something in the site engine managed in this way.Thanks to
everyone who responded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question