add (hidden) _NGINX_XACCEL_PREFIX which uses nginx X-Accel-Redirect to serve static files faster

master
Andrew Dolgov 6 years ago
parent 04ad631a08
commit c5c3a0a2a8

@ -2586,7 +2586,13 @@
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT"; $stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
header("Last-Modified: $stamp", true); header("Last-Modified: $stamp", true);
if (defined('_NGINX_XACCEL_PREFIX') && _NGINX_XACCEL_PREFIX) {
header("X-Accel-Redirect: " . _NGINX_XACCEL_PREFIX . "/" . $filename);
return false;
} else {
return readfile($filename); return readfile($filename);
}
} else { } else {
return false; return false;
} }

Loading…
Cancel
Save