File tree 4 files changed +20
-1
lines changed
integration/default/controls
4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ This file is used to list changes made in each version of the nginx cookbook.
4
4
5
5
## Unreleased
6
6
7
+ - Correct trailing semicolon for blocks - [ #643 ] ( https://github.com/sous-chefs/nginx/issues/643 )
8
+ - Support multiple options - [ #644 ] ( https://github.com/sous-chefs/nginx/issues/644 )
9
+
7
10
## 12.2.13 - * 2025-01-07*
8
11
9
12
- Convert all test files to proper InSpec format with controls and metadata
Original file line number Diff line number Diff line change @@ -57,7 +57,13 @@ server {
57
57
location <%= location %> {
58
58
<% unless nil_or_empty?(options) -%>
59
59
<% options.each do |option, value| -%>
60
- <%= option %> <% unless nil_or_empty?(value) -%> <%= value %> <% end -%> ;
60
+ <% if nil_or_empty?(value) -%>
61
+ <%= option %> ;
62
+ <% else -%>
63
+ <% Array(value).each do |val| -%>
64
+ <%= option %> <%= val %> <% unless String(val).end_with?('}') -%> ;<% end -%>
65
+ <% end -%>
66
+ <% end -%>
61
67
<% end -%>
62
68
<% end -%>
63
69
}
Original file line number Diff line number Diff line change 26
26
'/' => {
27
27
'root' => '/var/www/nginx-default' ,
28
28
'index' => 'index.html index.htm' ,
29
+ 'proxy_set_header' => [
30
+ 'Connection ""' ,
31
+ 'X-My-Real-IP $remote_addr' ,
32
+ 'X-My-Real-Port $remote_port' ,
33
+ 'X-My-Server-Port $server_port' ,
34
+ ] ,
35
+ 'limit_except' => 'GET POST { deny all; }' ,
29
36
} ,
30
37
} ,
31
38
}
Original file line number Diff line number Diff line change 87
87
it { should exist }
88
88
it { should be_file }
89
89
its ( 'mode' ) { should cmp '0644' }
90
+ its ( 'content' ) { should include 'proxy_set_header X-My-Real-IP $remote_addr;' }
91
+ its ( 'content' ) { should include 'proxy_set_header X-My-Real-Port $remote_port;' }
92
+ its ( 'content' ) { should include 'limit_except GET POST { deny all; }' }
90
93
end
91
94
92
95
describe file ( '/etc/nginx/conf.http.d/test_site_disabled.conf.disabled' ) do
You can’t perform that action at this time.
0 commit comments