don't generate unnecessary php-related vhost-entries when php is disabled, thx to karstenk

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-06-14 07:29:38 +02:00
parent 5866293a25
commit 88ccf5b869

View File

@@ -859,9 +859,24 @@ class nginx extends HttpConfigBase {
$this->_deactivated = false;
}
$webroot_text .= "\t" . 'index index.php index.html index.htm;'."\n";
if ($domain['phpenabled'] == '1')
{
$webroot_text .= "\t" . 'index index.php index.html index.htm;'."\n";
}
else
{
$webroot_text .= "\t" . 'index index.html index.htm;'."\n";
}
$webroot_text .= "\n\t".'location / {'."\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;'."\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/';
if ($domain['phpenabled'] == '1')
{
$webroot_text .= ' @rewrites;'."\n";
}
else
{
$webroot_text .= ";\n";
}
if ($this->vhost_root_autoindex) {
$webroot_text .= "\t\t".'autoindex on;'."\n";
@@ -869,9 +884,12 @@ class nginx extends HttpConfigBase {
}
$webroot_text .= "\t".'}'."\n\n";
$webroot_text .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n";
if ($domain['phpenabled'] == '1')
{
$webroot_text .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n";
}
return $webroot_text;
}