add domain flag to avoid generation of nginx try_files directive in webroot which is not suitable for some applications; fixes #461

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-13 08:12:58 +01:00
parent de70dbb888
commit 372ab5d9c8
9 changed files with 59 additions and 4 deletions

View File

@@ -916,7 +916,9 @@ class nginx extends HttpConfigBase
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$webroot_text .= "\t" . 'index index.php index.html index.htm;' . "\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
if ($domain['notryfiles'] != 1) {
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
}
} else {
$webroot_text .= "\t" . 'index index.html index.htm;' . "\n";
}
@@ -927,7 +929,7 @@ class nginx extends HttpConfigBase
}
$webroot_text .= "\t" . '}' . "\n\n";
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1' && $domain['notryfiles'] != 1) {
$webroot_text .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n";