From 81f3dbda31823310ad46ad5aec845dd57f576692 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 10 Apr 2023 09:33:43 +0200 Subject: [PATCH] respect no-try_files setting also in protected directories Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Nginx.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/Cron/Http/Nginx.php b/lib/Froxlor/Cron/Http/Nginx.php index 3db34e96..e7504320 100644 --- a/lib/Froxlor/Cron/Http/Nginx.php +++ b/lib/Froxlor/Cron/Http/Nginx.php @@ -1040,9 +1040,11 @@ class Nginx extends HttpConfigBase $path_options .= "\t\t" . 'auth_basic_user_file ' . FileDir::makeCorrectFile($single['usrf']) . ';' . "\n"; if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') { $path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n"; - $path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n"; - $path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n"; - $path_options .= "\t\t" . '}' . "\n\n"; + if ($domain['notryfiles'] != 1) { + $path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n"; + $path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n"; + $path_options .= "\t\t" . '}' . "\n\n"; + } } else { $path_options .= "\t\t" . 'index index.html index.htm;' . "\n"; }