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

Modularize Nginx wordpress-site.conf.j2 and add Nginx conf hooks #688

Closed
wants to merge 2 commits into from

Conversation

fullyint
Copy link
Contributor

Trellis Nginx includes have been limited to one location, inside the primary server block. This PR adds hooks to enable users to include files or inject snippets in other locations (e.g., outside server block). Here is an example of needing to inject a directive in the http context.

The docs in roots/docs#57 will be most helpful for understanding the intent of this PR. Builds on #687

This PR is simpler than it looks. The first commit accounts for most all the PR's additions/deletions, and doesn't change code. It just breaks the WordPress site conf out into separate modules/files. The second commit (Nginx hooks) adds only 13 lines.

The modularization of the Nginx confs is for convenience, to make the sections clear amongst all the jinja templating complexity. This is the approach already in use for roles/wordpress-setup/templates/https.conf.j2.

The one change made in the modularization is that this PR moves the base WordPress conf out of the nginx role into the wordpress-setup role. This changes this base WP conf from an include whose content is general to all sites, to content injected into each site's conf such that it can be customized per site, via the nginx_location hook.

@fullyint
Copy link
Contributor Author

fullyint commented Dec 1, 2016

I rebased to resolve merge conflicts that arose from the recently merged #692. Both PRs involve(d) caching stuff in Nginx confs.

I used the rebase as an opportunity to add a few tags: nginx-includes on tasks involving the new nginx hooks.

@nathanielks
Copy link
Contributor

@phil was about to create a PR adding some support for trellis living behind a server that does SSL termination, but I remembered this existed and was curious where we're at with this getting merged?

@nathanielks
Copy link
Contributor

Nevermind! I was able to do it pretty simply.

@fullyint
Copy link
Contributor Author

closed and replaced by the better solution in #740

@fullyint fullyint closed this Jan 24, 2017
@fullyint fullyint deleted the nginx-hooks branch January 24, 2017 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants