Closed ltning closed 10 months ago
Suggested patch against 3.3.0:
diff --git a/modules/nginx/manifests/resource/location.pp b/modules/nginx/manifests/resource/location.pp
index 4d7e245c..b7ac3116 100644
--- a/modules/nginx/manifests/resource/location.pp
+++ b/modules/nginx/manifests/resource/location.pp
@@ -265,7 +265,7 @@ define nginx::resource::location (
Boolean $ssl = false,
Boolean $ssl_only = false,
Optional[String] $location_alias = undef,
- Optional[String[1]] $limit_zone = undef,
+ Optional[Variant[String[1],Array[String[1],1]]] $limit_zone = undef,
Optional[Enum['any', 'all']] $location_satisfy = undef,
Optional[Array] $location_allow = undef,
Optional[Array] $location_deny = undef,
diff --git a/modules/nginx/templates/server/location_header.erb b/modules/nginx/templates/server/location_header.erb
index 7e526d11..f8c84c81 100644
--- a/modules/nginx/templates/server/location_header.erb
+++ b/modules/nginx/templates/server/location_header.erb
@@ -78,7 +78,13 @@
<%- end -%>
<% end -%>
<% if @limit_zone -%>
+ <%- if @limit_zone.is_a?(Array) then -%>
+ <%- for lz in @limit_zone -%>
+ limit_req zone=<%= lz %>;
+ <%- end -%>
+ <%- else -%>
limit_req zone=<%= @limit_zone %>;
+ <%- end -%>
<% end -%>
<% if @reset_timedout_connection -%>
reset_timedout_connection <%= @reset_timedout_connection %>;
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
What behaviour did you expect instead
Multiple
limit_req
statements in resulting nginx configurationAny additional information you'd like to impart
From https://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req: