From e543e0ec4aabdce63730af4a63016bf5b95ab03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=85=89?= Date: Fri, 29 Nov 2019 10:08:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E6=8E=A5=E4=B8=8B?= =?UTF-8?q?=E8=BD=BDheader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 经查阅以及实践,确定nginx与apache的header写反了。 --- app/function/file.function.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/function/file.function.php b/app/function/file.function.php index 3eb6a85..a85c9dd 100755 --- a/app/function/file.function.php +++ b/app/function/file.function.php @@ -1042,9 +1042,9 @@ function file_put_out($file,$download=-1,$downFilename=false){ $server = strtolower($_SERVER['SERVER_SOFTWARE']); if($server && $GLOBALS['config']['settings']['httpSendFile']){ if(strstr($server,'nginx')){//nginx - header("X-Sendfile: ".$file); - }else if(strstr($server,'apache')){ //apache header('X-Accel-Redirect: '.$file); + }else if(strstr($server,'apache')){ //apache + header("X-Sendfile: ".$file); }else if(strstr($server,'http')){//light http header( "X-LIGHTTPD-send-file: " . $file); } @@ -1447,4 +1447,4 @@ function write_log($log, $type = 'default', $level = 'log'){ } clearstatcache(); return error_log("$now_time $log\n", 3, $target); -} \ No newline at end of file +}