Repository navigation
feat: include project nginx config from server.d in templates - #163
Open
turegjorup wants to merge 2 commits into
Open
turegjorup wants to merge 2 commits into
turegjorup wants to merge 2 commits into
Conversation
Drupal and Symfony templates include .docker/templates/server.d/*.conf in the server block, so project-specific nginx rules survive template:update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lets projects keep their own nginx rules in
.docker/templates/server.d/sotemplate:updateno longer overwrites them.Changes
templates/{drupal,symfony}/.docker/templates/default.conf.template:include /etc/nginx/conf.d/server.d/*.conf;in theserverblock (also used bydrupal-10,drupal-11,symfony-6,symfony-7andsymfony-8through symlinks)README.md: where to keep project-specific changes (docker-compose.override.yml,docker-compose.server.override.ymland.docker/templates/server.d/)CHANGELOG.md: add entryWhy
template:updatecopies the template files over the project's own, so project-specific lines indefault.conf.templateare lost on every update. For example, event-database-imports serves its admin under/adminand needs a rewrite for its assets. A template update removed that rewrite, and it had to be restored in itk-dev/event-database-imports@2f59b75. The same update removed it again today.docker compose already has override files for this. nginx now has the same kind of override:
envsubston*.templatefiles in subfolders of/etc/nginx/templatesand writes them to the same subfolder inconf.d. Project files inserver.d/therefore get the same variable substitution asdefault.conf.template.conf.d/*.conf, not subfolders, soserver.d/*.confis only used through the newinclude.template:update(rsyncwithout--delete) leaves files the template doesn't ship, soserver.d/survives updates.includewith a wildcard that matches nothing is not an error. Both configs passnginx -twith noserver.d/folder, so existing projects need no changes.Tested in event-database-imports with the rewrite moved to
.docker/templates/server.d/app-path-prefix.conf.template: admin assets and routes load under/admin(itk-dev/event-database-imports#116).The EOL
drupal-8anddrupal-9templates are left unchanged.