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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user