Allow each amp instance to override the nginx vhost template #47
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.
In nginx, each application/instance is likely to need to a different configuration file -- for example, a Drupal template won't work with WordPress or Symfony. To resolve #21, the
amp create
command must be able to use different templates for different builds.This revision performs a structured search to determine the template, e.g.
* If the env has variable
NGINX_VHOST_TPL
, use that.* If the web-root or any parent has
.amp/nginx-vhost.php
, use that.* Otherwise, use the default template specified in
amp
.The PR is not specific to nginx -- if the
httpd
type is set toapache
orapache24
, it will conduct a similar search (e.g.APACHE_VHOST_TPL
and.amp/apache-vhost.php
; orAPACHE24_VHOST_TPL
and.amp/apache24-vhost.php
). However, the issue is most salient for nginx.