You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configurations/webservers-nginx.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,3 +39,43 @@ If you are using Ubuntu as your base OS and you want to get started quickly with
39
39
ssl_protocols TLSv1.1 TLSv1.2;
40
40
ssl_ciphers HIGH:!aNULL:!MD5;
41
41
```
42
+
43
+
### Customizing server block configuration
44
+
45
+
If you can't customize via variables because an option isn't exposed, you can override the template used to generate the the virtualhost configuration file.
You can either copy and modify the provided `nginx-vhost.conf.j2` template, or extend it and and override the specific template block you need to change.
52
+
53
+
_If you extend Drupal VM's provided base template, the path referenced should to be relative to the playbook.yml._
54
+
55
+
```
56
+
{% extends 'templates/nginx-vhost.conf.j2' %}
57
+
58
+
{% block location_primary %}
59
+
location / {
60
+
try_files $uri @rewrite; # For Drupal <= 6
61
+
}
62
+
{% endblock %}
63
+
64
+
{% block location_image_styles %}
65
+
location ~ ^/sites/.*/files/imagecache/ {
66
+
try_files $uri @rewrite; # For Drupal <= 6
67
+
}
68
+
{% endblock %}
69
+
```
70
+
71
+
If you need to append or prepend content to a block, you can use the `{{ super() }}` Jinja2 function to return the original block content from the base template.
0 commit comments