From cbf47f46ea682c07f8c28dc094f75a610197608a Mon Sep 17 00:00:00 2001 From: Stricted Date: Tue, 16 Sep 2014 21:15:08 +0200 Subject: [PATCH 1/3] fix directory index for folders on nginx --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index d7d2b0d8..e692a007 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -631,7 +631,7 @@ class nginx { $this->vhost_root_autoindex = false; } else { $path_options .= "\t".'location ' . $path . ' {' . "\n"; - if ($this->vhost_root_autoindex) { + if ($this->vhost_root_autoindex || $row['options_indexes'] != '0') { $path_options .= "\t\t" . 'autoindex on;' . "\n"; $this->vhost_root_autoindex = false; } From 024d01b300e1d53111cc5c67c47b4085994ba0dd Mon Sep 17 00:00:00 2001 From: Stricted Date: Tue, 16 Sep 2014 21:24:50 +0200 Subject: [PATCH 2/3] fix directory index for folders on nginx #2 --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index e692a007..ae88157f 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -598,7 +598,9 @@ class nginx { $path_options .= "\t".'# '.$path."\n"; if ($path == '/') { - $this->vhost_root_autoindex = true; + if ($row['options_indexes'] != '0') { + $this->vhost_root_autoindex = true; + } $path_options .= "\t".'location ' . $path . ' {' . "\n"; if ($this->vhost_root_autoindex) { $path_options .= "\t\t" . 'autoindex on;' . "\n"; From 141e728c0f2c1441d3ceb0e3d193f86624ce2565 Mon Sep 17 00:00:00 2001 From: Stricted Date: Tue, 16 Sep 2014 22:47:07 +0200 Subject: [PATCH 3/3] fix last commits --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index ae88157f..9ccd0d2d 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -606,7 +606,9 @@ class nginx { $path_options .= "\t\t" . 'autoindex on;' . "\n"; $this->vhost_root_autoindex = false; } - $path_options.= "\t\t" . 'index index.php index.html index.htm;'."\n"; + else { + $path_options.= "\t\t" . 'index index.php index.html index.htm;'."\n"; + } // $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 @@ -637,7 +639,9 @@ class nginx { $path_options .= "\t\t" . 'autoindex on;' . "\n"; $this->vhost_root_autoindex = false; } - $path_options .= "\t\t" . 'index index.php index.html index.htm;'."\n"; + else { + $path_options .= "\t\t" . 'index index.php index.html index.htm;'."\n"; + } $path_options .= "\t".'} ' . "\n"; } // }