regex replace / in resource::vhost Fixes #102
This commit is contained in:
parent
a2083e433f
commit
8845838390
1 changed files with 6 additions and 4 deletions
|
@ -84,8 +84,8 @@
|
|||
# }
|
||||
|
||||
define nginx::resource::location (
|
||||
$location,
|
||||
$ensure = present,
|
||||
$location = $name,
|
||||
$vhost = undef,
|
||||
$www_root = undef,
|
||||
$index_files = [
|
||||
|
@ -128,6 +128,8 @@ define nginx::resource::location (
|
|||
default => file,
|
||||
}
|
||||
|
||||
$location_sanitized = regsubst($location, '\/', '_', 'G')
|
||||
|
||||
## Check for various error conditions
|
||||
if ($vhost == undef) {
|
||||
fail('Cannot create a location reference without attaching to a virtual host')
|
||||
|
@ -164,7 +166,7 @@ define nginx::resource::location (
|
|||
|
||||
## Create stubs for vHost File Fragment Pattern
|
||||
if ($ssl_only != true) {
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${priority}-${name}":
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${priority}-${location_sanitized}":
|
||||
ensure => $ensure_real,
|
||||
content => $content_real,
|
||||
}
|
||||
|
@ -173,7 +175,7 @@ define nginx::resource::location (
|
|||
## Only create SSL Specific locations if $ssl is true.
|
||||
if ($ssl == true) {
|
||||
$ssl_priority = $priority + 300
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${ssl_priority}-${name}-ssl":
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${ssl_priority}-${location_sanitized}-ssl":
|
||||
ensure => $ensure_real,
|
||||
content => $content_real,
|
||||
}
|
||||
|
@ -181,7 +183,7 @@ define nginx::resource::location (
|
|||
|
||||
if ($auth_basic_user_file != undef) {
|
||||
#Generate htpasswd with provided file-locations
|
||||
file { "${nginx::params::nx_conf_dir}/${name}_htpasswd":
|
||||
file { "${nginx::params::nx_conf_dir}/${location_sanitized}_htpasswd":
|
||||
ensure => $ensure,
|
||||
mode => '0644',
|
||||
source => $auth_basic_user_file,
|
||||
|
|
Loading…
Reference in a new issue