Skip to content

Commit cf1d7cf

Browse files
Implement proxy_next_upstream_tries and proxy_next_upstream_timeout
1 parent f8b913c commit cf1d7cf

4 files changed

Lines changed: 56 additions & 0 deletions

File tree

REFERENCE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,8 @@ The following parameters are available in the `nginx::resource::location` define
19821982
* [`proxy_pass_header`](#-nginx--resource--location--proxy_pass_header)
19831983
* [`proxy_ignore_header`](#-nginx--resource--location--proxy_ignore_header)
19841984
* [`proxy_next_upstream`](#-nginx--resource--location--proxy_next_upstream)
1985+
* [`proxy_next_upstream_tries`](#-nginx--resource--location--proxy_next_upstream_tries)
1986+
* [`proxy_next_upstream_timeout`](#-nginx--resource--location--proxy_next_upstream_timeout)
19851987
* [`grpc`](#-nginx--resource--location--grpc)
19861988
* [`fastcgi`](#-nginx--resource--location--fastcgi)
19871989
* [`fastcgi_param`](#-nginx--resource--location--fastcgi_param)
@@ -2251,6 +2253,22 @@ Specify cases a request should be passed to the next server in the upstream.
22512253

22522254
Default value: `undef`
22532255

2256+
##### <a name="-nginx--resource--location--proxy_next_upstream_tries"></a>`proxy_next_upstream_tries`
2257+
2258+
Data type: `Optional[Integer]`
2259+
2260+
Specify the limits the number of possible tries for passing a request to the next server.
2261+
2262+
Default value: `undef`
2263+
2264+
##### <a name="-nginx--resource--location--proxy_next_upstream_timeout"></a>`proxy_next_upstream_timeout`
2265+
2266+
Data type: `Optional[Nginx::Time]`
2267+
2268+
Specify the limits the time during which a request can be passed to the next server
2269+
2270+
Default value: `undef`
2271+
22542272
##### <a name="-nginx--resource--location--grpc"></a>`grpc`
22552273

22562274
Data type: `Optional[String]`
@@ -3509,6 +3527,8 @@ The following parameters are available in the `nginx::resource::server` defined
35093527
* [`proxy_max_temp_file_size`](#-nginx--resource--server--proxy_max_temp_file_size)
35103528
* [`proxy_busy_buffers_size`](#-nginx--resource--server--proxy_busy_buffers_size)
35113529
* [`proxy_next_upstream`](#-nginx--resource--server--proxy_next_upstream)
3530+
* [`proxy_next_upstream_tries`](#-nginx--resource--server--proxy_next_upstream_tries)
3531+
* [`proxy_next_upstream_timeout`](#-nginx--resource--server--proxy_next_upstream_timeout)
35123532
* [`grpc`](#-nginx--resource--server--grpc)
35133533
* [`resolver`](#-nginx--resource--server--resolver)
35143534
* [`fastcgi`](#-nginx--resource--server--fastcgi)
@@ -3938,6 +3958,22 @@ Specify cases a request should be passed to the next server in the upstream.
39383958

39393959
Default value: `undef`
39403960

3961+
##### <a name="-nginx--resource--server--proxy_next_upstream_tries"></a>`proxy_next_upstream_tries`
3962+
3963+
Data type: `Optional[Integer]`
3964+
3965+
Specify the limits the number of possible tries for passing a request to the next server.
3966+
3967+
Default value: `undef`
3968+
3969+
##### <a name="-nginx--resource--server--proxy_next_upstream_timeout"></a>`proxy_next_upstream_timeout`
3970+
3971+
Data type: `Optional[Nginx::Time]`
3972+
3973+
Specify the limits the time during which a request can be passed to the next server
3974+
3975+
Default value: `undef`
3976+
39413977
##### <a name="-nginx--resource--server--grpc"></a>`grpc`
39423978

39433979
Data type: `Optional[String]`

manifests/resource/location.pp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
# Array of server headers to ignore
5656
# @param proxy_next_upstream
5757
# Specify cases a request should be passed to the next server in the upstream.
58+
# @param proxy_next_upstream_tries
59+
# Specify the limits the number of possible tries for passing a request to the next server.
60+
# @param proxy_next_upstream_timeout
61+
# Specify the limits the time during which a request can be passed to the next server
5862
# @param grpc
5963
# Sets the gRPC server address (`grpc_pass`)
6064
# @param fastcgi
@@ -307,6 +311,8 @@
307311
Array $proxy_pass_header = $nginx::proxy_pass_header,
308312
Array $proxy_ignore_header = $nginx::proxy_ignore_header,
309313
Optional[String] $proxy_next_upstream = undef,
314+
Optional[Integer] $proxy_next_upstream_tries = undef,
315+
Optional[Nginx::Time] $proxy_next_upstream_timeout = undef,
310316
Optional[String] $grpc = undef,
311317
Optional[String] $fastcgi = undef,
312318
Optional[String] $fastcgi_index = undef,

manifests/resource/server.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@
9393
# client while the response is not yet fully read.
9494
# @param proxy_next_upstream
9595
# Specify cases a request should be passed to the next server in the upstream.
96+
# @param proxy_next_upstream_tries
97+
# Specify the limits the number of possible tries for passing a request to the next server.
98+
# @param proxy_next_upstream_timeout
99+
# Specify the limits the time during which a request can be passed to the next server
96100
# @param grpc
97101
# Sets the gRPC server address (`grpc_pass`)
98102
# @param resolver
@@ -374,6 +378,8 @@
374378
Array[String] $proxy_hide_header = $nginx::proxy_hide_header,
375379
Array[String] $proxy_pass_header = $nginx::proxy_pass_header,
376380
Optional[String[1]] $proxy_next_upstream = undef,
381+
Optional[Integer] $proxy_next_upstream_tries = undef,
382+
Optional[Nginx::Time] $proxy_next_upstream_timeout = undef,
377383
Optional[String] $proxy_cache = undef,
378384
Optional[String] $proxy_cache_key = undef,
379385
Optional[String] $proxy_cache_use_stale = undef,
@@ -585,6 +591,8 @@
585591
proxy_busy_buffers_size => $proxy_busy_buffers_size,
586592
proxy_max_temp_file_size => $proxy_max_temp_file_size,
587593
proxy_next_upstream => $proxy_next_upstream,
594+
proxy_next_upstream_tries => $proxy_next_upstream_tries,
595+
proxy_next_upstream_timeout => $proxy_next_upstream_timeout,
588596
grpc => $grpc,
589597
fastcgi => $fastcgi,
590598
fastcgi_index => $fastcgi_index,

templates/server/locations/proxy.erb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,10 @@
9090
<% if @proxy_next_upstream -%>
9191
proxy_next_upstream <%= @proxy_next_upstream %>;
9292
<% end -%>
93+
<% if @proxy_next_upstream_tries -%>
94+
proxy_next_upstream_tries <%= @proxy_next_upstream_tries %>;
95+
<% end -%>
96+
<% if @proxy_next_upstream_timeout -%>
97+
proxy_next_upstream_timeout <%= @proxy_next_upstream_timeout %>;
98+
<% end -%>
9399
<% end -%>

0 commit comments

Comments
 (0)