diff --git a/site/profiles/manifests/nginx/simpleproxy.pp b/site/profiles/manifests/nginx/simpleproxy.pp index 28d6c1e..7a497ae 100644 --- a/site/profiles/manifests/nginx/simpleproxy.pp +++ b/site/profiles/manifests/nginx/simpleproxy.pp @@ -12,6 +12,8 @@ class profiles::nginx::simpleproxy ( Stdlib::Port $proxy_port = 80, Stdlib::Host $proxy_host = $facts['networking']['ip'], String $proxy_path = '/', + Boolean $use_default_location = true, + Hash $locations = {}, ) { # if nginx_version isnt set, install nginx @@ -83,7 +85,7 @@ class profiles::nginx::simpleproxy ( $defaults = { 'listen_port' => $listen_port, 'server_name' => $server_names, - 'use_default_location' => true, + 'use_default_location' => $use_default_location, 'access_log' => "/var/log/nginx/${nginx_vhost}_access.log", 'error_log' => "/var/log/nginx/${nginx_vhost}_error.log", 'autoindex' => 'on', @@ -103,6 +105,11 @@ class profiles::nginx::simpleproxy ( # create the nginx vhost with the merged parameters create_resources('nginx::resource::server', { $nginx_vhost => $nginx_parameters }) + # create nginx locations + if $use_default_location == false { + create_resources('nginx::resource::location', $locations) + } + # manage selinux if $::facts['os']['selinux']['config_mode'] == 'enforcing' {