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

Reformat site_hosts to use canonical and redirects #45

Merged
merged 1 commit into from
Jul 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions trellis/deploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Configuration:
wordpress_sites:
mysite.com:
site_hosts:
- mysite.com
- canonical: mysite.com
local_path: ../site
repo: git@github.com:me/mysite.git
repo_subtree_path: site
Expand All @@ -147,4 +147,4 @@ ansible-playbook deploy.yml -e "site=mysite.com env=production"

## Rollbacks

To rollback a deploy, run `ansible-playbook rollback.yml -e "site=<domain> env=<environment>"`
To rollback a deploy, run `ansible-playbook rollback.yml -e "site=<domain> env=<environment>"`
24 changes: 21 additions & 3 deletions trellis/wordpress-sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ There are two components and places to configure sites:
wordpress_sites:
example.com:
site_hosts:
- example.dev
- canonical: example.dev
local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
admin_email: admin@example.dev
multisite:
Expand Down Expand Up @@ -71,8 +71,26 @@ For a complete working example of a real-life WordPress site, you can view the c

### Common

* `site_hosts` - array of hosts that Nginx will listen on (*required*, include main domain at least)
* `www_redirect` - whether to redirect `www/non-www` counterparts of `site_hosts` (default: `true`)
* `site_hosts` - List of hosts that Nginx will listen on. At least one is required. Each host item must specify a `canonical` host and may optionally specify a list of corresponding `redirects` (hosts). Remember to set up DNS for every host listed. (*required*)

```
# minimum required
example.com:
site_hosts:
- canonical: example.com

# multiple hosts and redirects are possible
example.com:
site_hosts:
- canonical: example.com
redirects:
- www.example.com
- site.com
- canonical: example.co.uk
redirects:
- www.example.co.uk
```

* `local_path` - path targeting Bedrock-based site directory (*required*)
* `current_path` - symlink to latest release (default: `current`)
* `db_create` - whether to auto create a database or not (default: `true`)
Expand Down