feat(ssl): support multiple certificates per site #569
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.
The rationale behind my desire for this change is explained here:
#557
So, what does this change do?
server {}
block template has been moved from the usual vHost template so that it can be included programmatically with different variables. Each certificate will include it's own block, with the correct values set. A default non SSL block will be included too, supporting all domains.What are the downsides?
map $ssl_host_name $sslKey{{$site_id}}
to dynamically load the SSL config, but that would require making each SSL cert readable by the configured user for that site (since dynamic loading would happen after nginx de-escalates it's permissions from root). This issue can be mitigated in future with the change from feat(redirects): add redirects to sites #552 - more sections of the config can be dynamically loaded and thus minimise change still.Migration?
domains
field on the SSL table. So if an existing vHost is regenerated then it'll continue to work as normal.