From b3451f1cc2a4204b85ed416a45b737d9f4bb6cd9 Mon Sep 17 00:00:00 2001 From: kkigomi Date: Wed, 25 Jan 2023 16:58:00 +0900 Subject: [PATCH] =?UTF-8?q?rewrite=20=EC=84=A4=EC=A0=95=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B4=EA=B8=B0=EC=97=90=EC=84=9C=20=EA=B8=B0?= =?UTF-8?q?=EC=A1=B4=20hook=20=EB=B3=B4=EB=8B=A4=20=EC=95=9E=EC=84=A0=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EC=9C=84=EC=B9=98=EC=97=90=20hook=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존 rule 때문에 hook으로 추가해도 접근 차단등의 룰을 적용하지 못하는 문제를 해결하기 위함 - add_nginx_conf_pre_rules - add_mod_rewrite_pre_rules --- lib/uri.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/uri.lib.php b/lib/uri.lib.php index 87c82ffc1..d43b00c34 100644 --- a/lib/uri.lib.php +++ b/lib/uri.lib.php @@ -305,6 +305,11 @@ function get_nginx_conf_rules($return_string = false) $rules = array(); $rules[] = '#### ' . G5_VERSION . ' nginx rules BEGIN #####'; + + if ($add_rules = run_replace('add_nginx_conf_pre_rules', '', $get_path_url, $base_path, $return_string)) { + $rules[] = $add_rules; + } + $rules[] = 'if (!-e $request_filename) {'; if ($add_rules = run_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string)) { @@ -334,6 +339,11 @@ function get_mod_rewrite_rules($return_string = false) $rules[] = ''; $rules[] = 'RewriteEngine On'; $rules[] = 'RewriteBase ' . $base_path; + + if ($add_rules = run_replace('add_mod_rewrite_pre_rules', '', $get_path_url, $base_path, $return_string)) { + $rules[] = $add_rules; + } + $rules[] = 'RewriteCond %{REQUEST_FILENAME} -f [OR]'; $rules[] = 'RewriteCond %{REQUEST_FILENAME} -d'; $rules[] = 'RewriteRule ^ - [L]';