-
-
Notifications
You must be signed in to change notification settings - Fork 607
Fil 8000 ter Nginx includes by sites present on target server #1573
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
Filter Nginx includes by sites present on target server #1573
Conversation
Docs added: roots/docs#544 |
Is there really a point to this though? Even if someone customized that block, I'm not sure why they'd change the "all" folder. And I'm not sure I see a use case for having more than one when they do the same thing? Personally I'd rather just omit this extra functionality since I don't see any use case. |
I have to admit I didn't question the "why" someone might want to, only that they can elsewhere and so that should probably be catered for. Otherwise someone else in a few month's time might stumble across it and raise it as a bug for you guys to spend time reviewing & maybe fixing. Doesn't affect me personally so I'm happy to take it out if you say so but given it's already there and keeps that functionality complete, I'd vote for it to stay in. Let me know what you decide 👍 |
Let's remove it and keep this simple ✨ |
Thanks! |
Ability to override the default 'all' folder has been removed (2d47410) Tested the key motivation for this PR:
Tested existing functionality hasn't been affected:
|
One for those of us using multiple remote servers with Trellis.
Currently, Trellis templates out anything you put into
nginx-includes/
to the remote servers. Take the following:Assume server1 has a different site(s) to server2, and perhaps staging1 and staging 2 have additional sites. Your Nginx includes folder might look like this:
All servers will end up with all Nginx includes files, even if the sites don't exist on that server:
This PR filters the Nginx includes that are to be 'included' by combining the sites that exist on the target server (taken from wordpress_sites keys) with a default 'all'. This follows with the default setup shown in the docs.
Also included is the ability to override the default 'all' folder. I've only included this because it is possible to override the block in the Nginx conf template and if someone did that, they may also want to determine their own Nginx includes locations.To override or otherwise add to the Nginx includes locations, in e.g.group_vars/all/main.yml
you can do# Edit: this change was removed
Note: in testing, the folders for sites not present on a remote are not cleaned up if they already exist but the files inside them are. That's to do with what happens when setting
nginx_includes_d_cleanup: true
which is a separate issue.