From 788df4b518ec70cca4b1e1a9a43231baafa4544e Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 11 May 2020 15:17:05 +0800 Subject: [PATCH] fix: proxy remote addr --- platform/normal.php | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/normal.php b/platform/normal.php index 432211d..c56577b 100644 --- a/platform/normal.php +++ b/platform/normal.php @@ -3,6 +3,7 @@ function getpath() { $_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]); + if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR']; $_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/'); $p = strpos($_SERVER['REQUEST_URI'],'?'); if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);