Merge pull request #86 from abraham1901/master
Add location priority option
This commit is contained in:
commit
fc331e8173
2 changed files with 18 additions and 12 deletions
|
@ -31,6 +31,10 @@
|
||||||
# with HTTP Basic Authentication.
|
# with HTTP Basic Authentication.
|
||||||
# [*auth_basic_user_file*] - This directive sets the htpasswd filename for
|
# [*auth_basic_user_file*] - This directive sets the htpasswd filename for
|
||||||
# the authentication realm.
|
# the authentication realm.
|
||||||
|
# [*priority*] - Location priority. Default: 500. User priority
|
||||||
|
# 400-499, 501-599. If the priority is higher than the default priority,
|
||||||
|
# the location will be defined after root, or before root.
|
||||||
|
#
|
||||||
#
|
#
|
||||||
# Actions:
|
# Actions:
|
||||||
#
|
#
|
||||||
|
@ -85,7 +89,8 @@ define nginx::resource::location (
|
||||||
$proxy_cache = false,
|
$proxy_cache = false,
|
||||||
$proxy_cache_valid = false,
|
$proxy_cache_valid = false,
|
||||||
$auth_basic = undef,
|
$auth_basic = undef,
|
||||||
$auth_basic_user_file = undef
|
$auth_basic_user_file = undef,
|
||||||
|
$priority = 500
|
||||||
) {
|
) {
|
||||||
File {
|
File {
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
|
@ -128,7 +133,7 @@ define nginx::resource::location (
|
||||||
|
|
||||||
## Create stubs for vHost File Fragment Pattern
|
## Create stubs for vHost File Fragment Pattern
|
||||||
if ($ssl_only != true) {
|
if ($ssl_only != true) {
|
||||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-500-${name}":
|
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${priority}-${name}":
|
||||||
ensure => $ensure_real,
|
ensure => $ensure_real,
|
||||||
content => $content_real,
|
content => $content_real,
|
||||||
}
|
}
|
||||||
|
@ -136,7 +141,8 @@ define nginx::resource::location (
|
||||||
|
|
||||||
## Only create SSL Specific locations if $ssl is true.
|
## Only create SSL Specific locations if $ssl is true.
|
||||||
if ($ssl == true) {
|
if ($ssl == true) {
|
||||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-800-${name}-ssl":
|
$ssl_priority = $priority + 300
|
||||||
|
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${ssl_priority}-${name}-ssl":
|
||||||
ensure => $ensure_real,
|
ensure => $ensure_real,
|
||||||
content => $content_real,
|
content => $content_real,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue