Skip to content

Commit

Permalink
修复Docker版无法生成文件索引
Browse files Browse the repository at this point in the history
  • Loading branch information
helloxz committed Oct 25, 2020
1 parent 434e438 commit 4e8b213
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions functions/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ function get_url(){
}

//$uri = str_replace("cache.php","",$uri);
//组合为完整的URL
$domain = $protocol.$_SERVER['HTTP_HOST'].$port.$uri;
//如果主机名是localhost,则获取localhost
if( $_SERVER['SERVER_NAME'] == 'localhost' ) {
$domain = $protocol.$_SERVER['SERVER_NAME'].$port.$uri;
}
else {
$domain = $protocol.$_SERVER['HTTP_HOST'].$port.$uri;
}

return $domain;
}
?>
Expand Down

0 comments on commit 4e8b213

Please sign in to comment.