diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index 8117e05e4..2db0eebb5 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -230,7 +230,7 @@ fastcgi_script => $fastcgi_script, try_files => $try_files, www_root => $www_root, - index_files => $index_files, + index_files => undef, location_custom_cfg => $location_custom_cfg, notify => Class['nginx::service'], } diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index 231160d52..b25fd42f9 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -31,6 +31,9 @@ server { return 301 https://$host$request_uri; } <% end -%> +<% if @index_files -%> + index <% @index_files.each do |i| %> <%= i %><% end %>; +<% end -%> access_log <%= @access_log_real %>; error_log <%= @error_log_real %>; diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 213b2c559..b1c68c229 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -20,6 +20,9 @@ server { <% if defined? @auth_basic_user_file -%> auth_basic_user_file "<%= @auth_basic_user_file %>"; <% end -%> +<% if @index_files -%> + index <% @index_files.each do |i| %> <%= i %><% end %>; +<% end -%> access_log <%= @ssl_access_log %>; error_log <%= @ssl_error_log %>;