From 971e1a7692a8709af9aeff3a2878cc48bc3e38d9 Mon Sep 17 00:00:00 2001 From: Markus Rekkenbeil Date: Mon, 10 Feb 2014 18:14:18 +0100 Subject: [PATCH 1/2] Update vhost_location documentation and template --- manifests/resource/vhost.pp | 4 ++-- templates/vhost/vhost_location_directory.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index d88052a9b..dbdb98b31 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -27,8 +27,8 @@ # response code is equal to 200, 204, 301, 302 or 304. # [*index_files*] - Default index files for NGINX to read when # traversing a directory -# [*autoindex*] - Set it on 'on' to activate autoindex directory -# listing. Undef by default. +# [*autoindex*] - Set it on 'on' or 'off 'to activate/deactivate +# autoindex directory listing. Undef by default. # [*proxy*] - Proxy server(s) for the root location to connect # to. Accepts a single value, can be used in conjunction with # nginx::resource::upstream diff --git a/templates/vhost/vhost_location_directory.erb b/templates/vhost/vhost_location_directory.erb index c0995b0d2..36874abbf 100644 --- a/templates/vhost/vhost_location_directory.erb +++ b/templates/vhost/vhost_location_directory.erb @@ -17,8 +17,8 @@ <% if @try_files -%> try_files<% @try_files.each do |try| -%> <%= try %><% end -%>; <% end -%> -<% if @autoindex == 'on' -%> - autoindex on; +<% if defined? @autoindex -%> + autoindex <%= @autoindex %>; <% end -%> <% if @index_files.count > 0 -%> index <% Array(@index_files).each do |i| %> <%= i %><% end %>; From 8cc32d40760b786481d62a8711e6f896d51bdd81 Mon Sep 17 00:00:00 2001 From: Markus Rekkenbeil Date: Mon, 10 Feb 2014 18:45:34 +0100 Subject: [PATCH 2/2] Bugfix: Add missing parameter for location template --- manifests/resource/vhost.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index dbdb98b31..4012a76ce 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -392,6 +392,7 @@ fastcgi_script => $fastcgi_script, try_files => $try_files, www_root => $www_root, + autoindex => $autoindex, index_files => [], location_custom_cfg => $location_custom_cfg, notify => Class['nginx::service'],