From 7ec777c9dd9d840ed6b127b08fe2a1191f7f2014 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 20 Jun 2016 09:55:27 +0200 Subject: [PATCH] put index back in location-context; try_files not really necessary if not using PHP, also eases use of proxy_pass users; thx to karstenk Signed-off-by: Michael Kaufmann (d00p) --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 3f723b69..de1c69be 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -671,7 +671,7 @@ class nginx extends HttpConfigBase { $path_options .= "\t\t" . 'autoindex on;' . "\n"; $this->vhost_root_autoindex = false; } - // $path_options.= "\t\t" . 'try_files $uri $uri/ @rewrites;'."\n"; + // check if we have a htpasswd for this path // (damn nginx does not like more than one // 'location'-part with the same path) @@ -859,24 +859,17 @@ class nginx extends HttpConfigBase { $this->_deactivated = false; } + $webroot_text .= "\n\t".'location / {'."\n"; + if ($domain['phpenabled'] == '1') { $webroot_text .= "\t" . 'index index.php index.html index.htm;'."\n"; + $webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;'."\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/'; - if ($domain['phpenabled'] == '1') - { - $webroot_text .= ' @rewrites;'."\n"; - } - else - { - $webroot_text .= ";\n"; - } if ($this->vhost_root_autoindex) { $webroot_text .= "\t\t".'autoindex on;'."\n";