diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index 1e650b943..d655c8921 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -3,15 +3,16 @@ # This definition creates a new location entry within a virtual host # # Parameters: -# [*ensure*] - Enables or disables the specified location (present|absent) -# [*vhost*] - Defines the default vHost for this location entry to include with -# [*location*] - Specifies the URI associated with this location entry -# [*www_root*] - Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy -# [*index_files*] - Default index files for NGINX to read when traversing a directory -# [*proxy*] - Proxy server(s) for a location to connect to. Accepts a single value, can be used in conjunction -# with nginx::resource::upstream -# [*ssl*] - Indicates whether to setup SSL bindings for this location. -# [*option*] - Reserved for future use +# [*ensure*] - Enables or disables the specified location (present|absent) +# [*vhost*] - Defines the default vHost for this location entry to include with +# [*location*] - Specifies the URI associated with this location entry +# [*www_root*] - Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy +# [*index_files*] - Default index files for NGINX to read when traversing a directory +# [*proxy*] - Proxy server(s) for a location to connect to. Accepts a single value, can be used in conjunction +# 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. +# [*option*] - Reserved for future use # # Actions: # @@ -25,13 +26,14 @@ # vhost => 'test2.local', # } define nginx::resource::location( - $ensure = present, - $vhost = undef, - $www_root = undef, - $index_files = ['index.html', 'index.htm', 'index.php'], - $proxy = undef, - $ssl = false, - $option = undef, + $ensure = present, + $vhost = undef, + $www_root = undef, + $index_files = ['index.html', 'index.htm', 'index.php'], + $proxy = undef, + $proxy_read_timeout = $nginx::params::nx_proxy_read_timeout, + $ssl = false, + $option = undef, $location ) { File { diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index 4349038e5..9df602b3d 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -13,6 +13,7 @@ # [*index_files*] - Default index files for NGINX to read when traversing a directory # [*proxy*] - Proxy server(s) for the root location to connect to. Accepts a single value, can be used in # conjunction 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 vhost. # [*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. @@ -31,18 +32,19 @@ # ssl_key => '/tmp/server.pem', # } define nginx::resource::vhost( - $ensure = 'enable', - $listen_ip = '*', - $listen_port = '80', - $ipv6_enable = false, - $ipv6_listen_ip = '::', - $ipv6_listen_port = '80', - $ssl = false, - $ssl_cert = undef, - $ssl_key = undef, - $proxy = undef, - $index_files = ['index.html', 'index.htm', 'index.php'], - $www_root = undef + $ensure = 'enable', + $listen_ip = '*', + $listen_port = '80', + $ipv6_enable = false, + $ipv6_listen_ip = '::', + $ipv6_listen_port = '80', + $ssl = false, + $ssl_cert = undef, + $ssl_key = undef, + $proxy = undef, + $proxy_read_timeout = $nginx::params::nx_proxy_read_timeout, + $index_files = ['index.html', 'index.htm', 'index.php'], + $www_root = undef ) { File { @@ -77,13 +79,14 @@ # Create the default location reference for the vHost nginx::resource::location {"${name}-default": - ensure => $ensure, - vhost => $name, - ssl => $ssl, - location => '/', - proxy => $proxy, - www_root => $www_root, - notify => Class['nginx::service'], + ensure => $ensure, + vhost => $name, + ssl => $ssl, + location => '/', + proxy => $proxy, + proxy_read_timeout => $proxy_read_timeout, + www_root => $www_root, + notify => Class['nginx::service'], } # Create a proper file close stub. diff --git a/templates/vhost/vhost_location_proxy.erb b/templates/vhost/vhost_location_proxy.erb index bfb5854fd..c653b4d27 100644 --- a/templates/vhost/vhost_location_proxy.erb +++ b/templates/vhost/vhost_location_proxy.erb @@ -1,4 +1,5 @@ location <%= location %> { proxy_pass <%= proxy %>; + proxy_read_timeout <%= proxy_read_timeout %>; }