Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional nginx sites configurations support #793

Merged
merged 2 commits into from
Mar 23, 2017

Conversation

medfreeman
Copy link
Contributor

closes #786

Add a nginx_sites_conf array
to allow users to specify custom nginx confs to be templated to the server's
nginx/sites-available folder, that are then symlinked to nginx/sites-enabled.
Array element properties:

  • src: jinja template path
  • enabled: whether to enable / disable the site conf
    by symlinking it to nginx/sites-enabled / removing it (default true)

Default:

nginx_sites_confs:
  - src: no-default.conf.j2

Add nginx-sites playbook tag.

@swalkinshaw
Copy link
Member

Looks great 👍

Thanks for the work and patience on this

@fullyint
Copy link
Contributor

Works in my tests (and it unearthed #795 👍).
Thanks for this!

For the docs, yeah, I think some-name.conf.site.j2 is fine to suggest as a convention. You understood it all, that the child template convention of *.child is just to avoid the default templating to includes.d. People can use the convention or not. It is harmless to template extra files to includes.d that aren't part of the sitename subdirs.

@medfreeman
Copy link
Contributor Author

Thanks to you both ! @fullyint i finally commited your code, i hope you don't mind !
Taking my time writing the doc, hope to be the clearest possible.

Next proposition in a week or two, have something like an 'external' or 'proxy' ssl setting / proxy conf to handle ssl termination.
Rationale: it needs changes in a lot of places, is hard to maintain, but again not sure if it warrants a PR or something more like a recipe

@fullyint
Copy link
Contributor

Regarding SSL termination, the only prior discussion I recall was partial accommodation in #732. We ultimately figured child templates could handle the particular changes of #732, as implemented in "Child template example – complex."

@swalkinshaw swalkinshaw merged commit 7894d2d into roots:master Mar 23, 2017
@swalkinshaw
Copy link
Member

Thanks 🚀

@medfreeman medfreeman deleted the add-nginx-sites-conf branch March 28, 2017 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow customizing the default site's Nginx configuration
3 participants