rewrite 설정 코드 보기에서 기존 hook 보다 앞선 출력 위치에 hook 추가
기존 rule 때문에 hook으로 추가해도 접근 차단등의 룰을 적용하지 못하는 문제를 해결하기 위함 - add_nginx_conf_pre_rules - add_mod_rewrite_pre_rules
This commit is contained in:
@ -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[] = '<IfModule mod_rewrite.c>';
|
||||
$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]';
|
||||
|
||||
Reference in New Issue
Block a user