1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-20 21:11:28 +00:00

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

This commit is contained in:
Andrew Dolgov
2018-08-20 09:14:10 +03:00
parent 04ad631a08
commit c5c3a0a2a8

View File

@@ -2586,7 +2586,13 @@
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
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);
}
} else {
return false;
}