Merge remote-tracking branch 'grooverdan/ticket/11667-try_files_support'
This commit is contained in:
commit
4aa2dd3d35
3 changed files with 21 additions and 12 deletions
|
@ -12,6 +12,7 @@
|
|||
# with nginx::resource::upstream
|
||||
# [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds
|
||||
# [*ssl*] - Indicates whether to setup SSL bindings for this location.
|
||||
# [*try_files*] - An array of file locations to try
|
||||
# [*option*] - Reserved for future use
|
||||
#
|
||||
# Actions:
|
||||
|
@ -33,6 +34,7 @@ define nginx::resource::location(
|
|||
$proxy = undef,
|
||||
$proxy_read_timeout = $nginx::params::nx_proxy_read_timeout,
|
||||
$ssl = false,
|
||||
$try_files = undef,
|
||||
$option = undef,
|
||||
$location
|
||||
) {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
# [*ssl_cert*] - Pre-generated SSL Certificate file to reference for SSL Support. This is not generated by this module.
|
||||
# [*ssl_key*] - Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module.
|
||||
# [*www_root*] - Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy
|
||||
# [*try_files*] - Specifies the locations for files to be checked as an array. Cannot be used in conjuction with $proxy.
|
||||
#
|
||||
# Actions:
|
||||
#
|
||||
|
@ -46,7 +47,8 @@ define nginx::resource::vhost(
|
|||
$proxy = undef,
|
||||
$proxy_read_timeout = $nginx::params::nx_proxy_read_timeout,
|
||||
$index_files = ['index.html', 'index.htm', 'index.php'],
|
||||
$www_root = undef
|
||||
$www_root = undef,
|
||||
$try_files = undef
|
||||
) {
|
||||
|
||||
File {
|
||||
|
@ -85,8 +87,9 @@ define nginx::resource::vhost(
|
|||
vhost => $name,
|
||||
ssl => $ssl,
|
||||
location => '/',
|
||||
proxy => $proxy,
|
||||
proxy_read_timeout => $proxy_read_timeout,
|
||||
proxy => $proxy,
|
||||
try_files => $try_files,
|
||||
www_root => $www_root,
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
location <%= location %> {
|
||||
root <%= www_root %>;
|
||||
index <% index_files.each do |i| %> <%= i %> <% end %>;
|
||||
|
||||
<% if has_variable?("try_files") then %>
|
||||
try_files <% try_files.each do |try| -%> <%= try %> <% end -%>;
|
||||
<% end %>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue