Skip to content

Commit 4ed788e

Browse files
committed
test(inspec): add test for log_format #219
1 parent 3679172 commit 4ed788e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/integration/default/controls/config.rb

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
it { should be_owned_by 'root' }
2323
it { should be_grouped_into 'root' }
2424
its('mode') { should cmp '0644' }
25+
its('content') { should include %Q[ log_format main '$remote_addr - $remote_user [$time_local] $status '
26+
'"$request" $body_bytes_sent "$http_referer" '
27+
'"$http_user_agent" "$http_x_forwarded_for"';] }
2528
end
2629

2730
# snippets configuration

test/salt/default/pillar/nginx.sls

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ nginx:
1010
letsencrypt:
1111
- location ^~ /.well-known/acme-challenge/:
1212
- proxy_pass: http://localhost:9999
13+
server:
14+
config:
15+
http:
16+
### module ngx_http_log_module example
17+
log_format: |-
18+
main '$remote_addr - $remote_user [$time_local] $status '
19+
'"$request" $body_bytes_sent "$http_referer" '
20+
'"$http_user_agent" "$http_x_forwarded_for"'
1321
servers:
1422
managed:
1523
default:

0 commit comments

Comments
 (0)