The current template inserts newlines after a location, which doesn't
seem logical; one can't assume there will always be more blocks that
follow. Therefore it is only logical to include the newline before a
new location block is inserted, which lends itself to the convention
of only prepending newlines to blocks, never appending them.
Without it, we get something like this:
```
error_log /var/log/nginx/my_error.log; location / {
root /var/www/html;
}
```
With this commit, we get this:
```
error_log /var/log/nginx/my_error.log;
location / {
root /var/www/html;
}
```
- added raw_prepend / raw_append to vhosts & locations, which
adds raw lines to the vhost/location /without/ semicolons
- added location_raw_prepend / location_raw_append to vhost
for passing through to default location
- added spec tests for new parameters
- cleaned up location specs to match new header/body/footer setup
reducing duplicate checks by testing header/footer separately.
- cleaned up whitespace (2 space) in touched files
- used `<%-` in erb templates to allow the use of leading
whitespace, making the logic flow more readable
- Also adds spec tests for recent vhost updates:
- client_body_timeout
- client_header_timeout
- gzip_types
- testing that the first server_name is used when www_to_non_www is true
- resurrecting jfryman/puppet-nginx#331 from @rainopik
- update (concat/stdlib) dependency version requirements based on current usage
- fix upstream tests to work with rainopik's changes in what was jfryman/puppet-nginx#331
- make many more things configurable
- stop using ::params::* for things that are configurable
- add worker_rlimit_nofile option
- add tcp_nopush option
Upstream members can no longer be exported and collected.
The change in #331 was fundamentally broken. I have therefore reverted
it as it shouldn't of been merged.
Essentially you can't use ensure with this change - meaning you can no
longer REMOVE an nginx config from the system - which is part of the
tests and also sane module practice.
The idea was nice - but the implementation broke things. This reverts
back to a good state, without modifying any tests where tests pass again
with the recent commits.
This reverts commit ebf3e4e58e.
For some reason these have been broken forever. Travis was failing,
correctly. I have updated the tests to be correct to how the code
actually works.
I would also suggest that if this is merged, we stop merging PRs that
have failed test runs. Tests matter in a module like this.