Merge pull request #545 from sanoma-technology/default_location_fix

Prevent missing resource errors if custom configuration is used without default location
This commit is contained in:
Matthew Haughton 2015-05-20 13:05:05 -04:00
commit f3d6fa5f53

View file

@ -543,37 +543,20 @@ define nginx::resource::vhost (
autoindex => $autoindex,
index_files => $index_files,
location_custom_cfg => $location_custom_cfg,
notify => Class['::nginx::service'],
location_cfg_prepend => $location_cfg_prepend,
location_cfg_append => $location_cfg_append,
location_custom_cfg_prepend => $location_custom_cfg_prepend,
location_custom_cfg_append => $location_custom_cfg_append,
rewrite_rules => $rewrite_rules,
raw_prepend => $location_raw_prepend,
raw_append => $location_raw_append
raw_append => $location_raw_append,
notify => Class['nginx::service'],
}
$root = undef
} else {
$root = $www_root
}
# Support location_cfg_prepend and location_cfg_append on default location created by vhost
if $location_cfg_prepend {
Nginx::Resource::Location["${name_sanitized}-default"] {
location_cfg_prepend => $location_cfg_prepend }
}
if $location_cfg_append {
Nginx::Resource::Location["${name_sanitized}-default"] {
location_cfg_append => $location_cfg_append }
}
if $location_custom_cfg_prepend {
Nginx::Resource::Location["${name_sanitized}-default"] {
location_custom_cfg_prepend => $location_custom_cfg_prepend }
}
if $location_custom_cfg_append {
Nginx::Resource::Location["${name_sanitized}-default"] {
location_custom_cfg_append => $location_custom_cfg_append }
}
if $fastcgi != undef and !defined(File[$fastcgi_params]) {
file { $fastcgi_params:
ensure => present,