From: Andrew Dolgov Date: Mon, 20 Aug 2018 06:14:10 +0000 (+0300) Subject: add (hidden) _NGINX_XACCEL_PREFIX which uses nginx X-Accel-Redirect to serve static... X-Git-Tag: 18.12~94 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c5c3a0a2a8febaa2b1ebcae6c17ff4398a9da6c7;p=tt-rss.git add (hidden) _NGINX_XACCEL_PREFIX which uses nginx X-Accel-Redirect to serve static files faster --- diff --git a/include/functions.php b/include/functions.php index b6e49716..a4e0e4d0 100755 --- a/include/functions.php +++ b/include/functions.php @@ -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; }