Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's this PR do?
Adds functionality and tests for prepending key/value pairs to the top of the nginx configuration. Tests mimicking the http_cfg_append tests have been added since this functionality is identical albeit in a different place. All rspec tests are currently passing. Furthermore, this change is currently working on a CentOS 6.6 (Final) staging box at a client site. I did not add to the README documentation since there doesn't seem to be a good place to put this. Let me know if there is somewhere you want me to add it.
Where should the reviewer start?
Begin in the manifests/config.pp file with the $nginx_cfg_prepend variable validation. Then check the templates/conf.d/nginx.conf.erb for the added nginx_cfg_prepend block.
How should this be tested?
By running
bundle exec rake spec
for the unit tests. Tests have been added for this change.Any background context you want to provide?
At Railsdog we support several sites that run Nginx/Passenger and Rbenv on RHEL derivatives. One of the requirements is to feed environment variables to the Passenger process via the Nginx config. This is easily accomplished by using http://nginx.org/en/docs/ngx_core_module.html#env. The only issue is that this variable can only occur at the top of the main nginx config block. Figured others could use this feature as well!