]> git.wh0rd.org Git - tt-rss.git/commitdiff
add (hidden) _NGINX_XACCEL_PREFIX which uses nginx X-Accel-Redirect to serve static...
authorAndrew Dolgov <noreply@fakecake.org>
Mon, 20 Aug 2018 06:14:10 +0000 (09:14 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Mon, 20 Aug 2018 06:14:10 +0000 (09:14 +0300)
include/functions.php

index b6e49716cd88ee710ede90a9fb835fb996f35761..a4e0e4d0221b70e579086dae9e0187c5406add86 100755 (executable)
                        $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;
                }