index_files to be defined at server level if specified in resource::vhost

This partially avoids pitfall #2 (http://wiki.nginx.org/Pitfalls)
This commit is contained in:
Daniel Black 2013-12-19 09:07:56 +10:00
parent b61c745012
commit 520eb23ffd
3 changed files with 7 additions and 1 deletions

View file

@ -230,7 +230,7 @@ define nginx::resource::vhost (
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'],
}

View file

@ -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 %>;

View file

@ -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 %>;