Merge pull request #231 from myii/chore/test-log_format

test(inspec): add test for `log_format` #219
This commit is contained in:
Niels Abspoel 2019-04-27 09:08:22 +02:00 committed by GitHub
commit 27711e2a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,9 @@ control 'Nginx configuration' do
it { should be_owned_by 'root' } it { should be_owned_by 'root' }
it { should be_grouped_into 'root' } it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' } its('mode') { should cmp '0644' }
its('content') { should include %Q[ log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';] }
end end
# snippets configuration # snippets configuration

View File

@ -10,6 +10,14 @@ nginx:
letsencrypt: letsencrypt:
- location ^~ /.well-known/acme-challenge/: - location ^~ /.well-known/acme-challenge/:
- proxy_pass: http://localhost:9999 - proxy_pass: http://localhost:9999
server:
config:
http:
### module ngx_http_log_module example
log_format: |-
main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
servers: servers:
managed: managed:
default: default: