Merge pull request #16 from cwarden/per-location-proxy-read-timeout
Add per-location proxy read timeout parameter
This commit is contained in:
commit
6cbefd7144
3 changed files with 41 additions and 35 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 @@ define nginx::resource::vhost(
|
|||
|
||||
# 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.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
location <%= location %> {
|
||||
proxy_pass <%= proxy %>;
|
||||
proxy_read_timeout <%= proxy_read_timeout %>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue