Merge pull request #16 from cwarden/per-location-proxy-read-timeout

Add per-location proxy read timeout parameter
This commit is contained in:
James Turnbull 2012-01-30 11:19:04 -08:00
commit 6cbefd7144
3 changed files with 41 additions and 35 deletions

View file

@ -10,6 +10,7 @@
# [*index_files*] - Default index files for NGINX to read when traversing a directory # [*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 # [*proxy*] - Proxy server(s) for a location to connect to. Accepts a single value, can be used in conjunction
# with nginx::resource::upstream # 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. # [*ssl*] - Indicates whether to setup SSL bindings for this location.
# [*option*] - Reserved for future use # [*option*] - Reserved for future use
# #
@ -30,6 +31,7 @@ define nginx::resource::location(
$www_root = undef, $www_root = undef,
$index_files = ['index.html', 'index.htm', 'index.php'], $index_files = ['index.html', 'index.htm', 'index.php'],
$proxy = undef, $proxy = undef,
$proxy_read_timeout = $nginx::params::nx_proxy_read_timeout,
$ssl = false, $ssl = false,
$option = undef, $option = undef,
$location $location

View file

@ -13,6 +13,7 @@
# [*index_files*] - Default index files for NGINX to read when traversing a directory # [*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 # [*proxy*] - Proxy server(s) for the root location to connect to. Accepts a single value, can be used in
# conjunction with nginx::resource::upstream # 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*] - 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_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. # [*ssl_key*] - Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module.
@ -41,6 +42,7 @@ define nginx::resource::vhost(
$ssl_cert = undef, $ssl_cert = undef,
$ssl_key = undef, $ssl_key = undef,
$proxy = undef, $proxy = undef,
$proxy_read_timeout = $nginx::params::nx_proxy_read_timeout,
$index_files = ['index.html', 'index.htm', 'index.php'], $index_files = ['index.html', 'index.htm', 'index.php'],
$www_root = undef $www_root = undef
) { ) {
@ -82,6 +84,7 @@ define nginx::resource::vhost(
ssl => $ssl, ssl => $ssl,
location => '/', location => '/',
proxy => $proxy, proxy => $proxy,
proxy_read_timeout => $proxy_read_timeout,
www_root => $www_root, www_root => $www_root,
notify => Class['nginx::service'], notify => Class['nginx::service'],
} }

View file

@ -1,4 +1,5 @@
location <%= location %> { location <%= location %> {
proxy_pass <%= proxy %>; proxy_pass <%= proxy %>;
proxy_read_timeout <%= proxy_read_timeout %>;
} }