Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 2882ce7

Browse files
committed
Remove custom nginx vhost task as geerlingguy.nginx supports custom templates
1 parent 52addfb commit 2882ce7

File tree

8 files changed

+11
-23
lines changed

8 files changed

+11
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it
9191
### 3 - Configure your host machine to access the VM.
9292

9393
1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM.
94-
- You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. `vagrant-hostmanager` is also supported.
94+
- You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_vhosts` will be automatically managed. `vagrant-hostmanager` is also supported.
9595
- The `auto_network` plugin (`vagrant plugin install vagrant-auto_network`) can help with IP address management if you set `vagrant_ip` to `0.0.0.0` inside `config.yml`.
9696
2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password.
9797

docs/configurations/webservers-nginx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
To use Nginx instead of Apache, change the `drupalvm_webserver` variable inside your customized `config.yml`, from `apache` to `nginx`.
22

3-
Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `default.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information.
3+
Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_vhosts` configuration. A few simple examples are shown in `default.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information.
44

55
Also, see the examples included in the [`geerlingguy.nginx` Ansible role's README](https://github.com/geerlingguy/ansible-role-nginx#readme) for more info, as well as many other variables you can override to configure Nginx exactly how you like it.
66

@@ -10,7 +10,7 @@ _Note: if you're using php-fpm, you may want to reflect your use of nginx by set
1010

1111
To enable SSL support for you virtual hosts you first need a certificate file. See the same section under the [Apache documentation](webservers-apache.md#enable-ssl-support-with-apache) for how to generate a self-signed certficiate.
1212

13-
Modify your nginx host configuration by adding the following `extra_parameters` to the first entry in `nginx_hosts`:
13+
Modify your nginx host configuration by adding the following `extra_parameters` to the first entry in `nginx_vhosts`:
1414

1515
```yaml
1616
- server_name: "{{ drupal_domain }} www.{{ drupal_domain }}"
@@ -48,7 +48,7 @@ If you can't customize via variables because an option isn't exposed, you can ov
4848
nginx_vhost_template: "{{ config_dir }}/templates/nginx-vhost.conf.j2"
4949
```
5050
51-
You can either copy and modify the provided `nginx-vhost.conf.j2` template, or extend it and override the specific template block you need to change.
51+
You can either copy and modify the provided `nginx-vhost.conf.j2` template, or extend it and use [template inheritace](http://jinja.pocoo.org/docs/2.9/templates/#template-inheritance) to override the specific template block you need to change.
5252

5353
_If you extend Drupal VM's provided base template, the path referenced should to be relative to playbook.yml._
5454

docs/deployment/multisite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable (or `nginx_hosts` if using Nginx), configure as many domains pointing to the same docroot as you need:
1+
For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable (or `nginx_vhosts` if using Nginx), configure as many domains pointing to the same docroot as you need:
22

33
```yaml
44
drupal_core_path: "/var/www/my-drupal-site"

examples/prod/prod.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
drupal_domain: "drupalvm.dev"
44
vagrant_hostname: "{{ drupal_domain }}"
55

6-
# Add only the `apache_vhosts` or `nginx_hosts` you need. If installing a
6+
# Add only the `apache_vhosts` or `nginx_vhosts` you need. If installing a
77
# single Drupal site, the variable should look like this (Apache):
88
apache_vhosts:
99
- servername: "{{ drupal_domain }}"

provisioning/roles/drupalvm.www/tasks/main.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,3 @@
8585
mode: 0755
8686
recurse: true
8787
when: drupalvm_webserver == 'apache'
88-
89-
- name: Copy Nginx vhosts into place.
90-
template:
91-
src: "{{ nginx_vhost_template }}"
92-
dest: "{{ nginx_vhost_path }}/{{ item.server_name.split(' ')[0] }}.conf"
93-
force: yes
94-
owner: root
95-
group: root
96-
mode: 0644
97-
with_items: "{{ nginx_hosts }}"
98-
notify: restart nginx
99-
when: drupalvm_webserver == 'nginx'

provisioning/templates/dashboard.html.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{%- endif -%}
3434
{%- endfor -%}
3535
{%- elif drupalvm_webserver == 'nginx' -%}
36-
{%- for host in nginx_hosts -%}
36+
{%- for host in nginx_vhosts -%}
3737
{%- if host.root == path -%}
3838
{{ host.server_name }}
3939
{%- endif -%}
@@ -73,7 +73,7 @@
7373

7474
{%- endfor -%}
7575
{%- elif drupalvm_webserver == 'nginx' -%}
76-
{%- for host in nginx_hosts -%}
76+
{%- for host in nginx_vhosts -%}
7777

7878
{% for server_name in host.server_name.split(' ') -%}
7979
{{ printHostsEntry(vagrant_ip, server_name) }}
@@ -107,7 +107,7 @@
107107
{%- endif -%}
108108
{%- endfor -%}
109109
{%- elif drupalvm_webserver == 'nginx' -%}
110-
{%- for host in nginx_hosts -%}
110+
{%- for host in nginx_vhosts -%}
111111
{%- if host.root is defined -%}
112112
{%- for hostname in host.server_name.split() -%}
113113
{{ printSite(hostname, host.root) }}

provisioning/templates/drupalvm-local.aliases.drushrc.php.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $aliases['{{ host }}'] = array(
2727
{%- endif -%}
2828
{%- endfor -%}
2929
{%- elif drupalvm_webserver == 'nginx' -%}
30-
{%- for host in nginx_hosts -%}
30+
{%- for host in nginx_vhosts -%}
3131
{%- for server_name in host.server_name.split() -%}
3232
{{ alias(server_name, host.root) }}
3333
{%- endfor -%}

provisioning/templates/drupalvm.aliases.drushrc.php.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $aliases['{{ host }}'] = array(
3333
{%- endif -%}
3434
{%- endfor -%}
3535
{%- elif drupalvm_webserver == 'nginx' -%}
36-
{%- for host in nginx_hosts -%}
36+
{%- for host in nginx_vhosts -%}
3737
{%- for server_name in host.server_name.split() -%}
3838
{{ alias(server_name, host.root) }}
3939
{%- endfor -%}

0 commit comments

Comments
 (0)