add (hidden) _NGINX_XACCEL_PREFIX which uses nginx X-Accel-Redirect to serve static files faster
This commit is contained in:
parent
04ad631a08
commit
c5c3a0a2a8
|
@ -2586,7 +2586,13 @@
|
|||
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
|
||||
header("Last-Modified: $stamp", true);
|
||||
|
||||
return readfile($filename);
|
||||
if (defined('_NGINX_XACCEL_PREFIX') && _NGINX_XACCEL_PREFIX) {
|
||||
header("X-Accel-Redirect: " . _NGINX_XACCEL_PREFIX . "/" . $filename);
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return readfile($filename);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue