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
{{ message }}
This repository was archived by the owner on Feb 13, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/configurations/webservers-nginx.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ If you are using Ubuntu as your base OS and you want to get started quickly with
45
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.
If you don't set these values, Drupal will think all requests are coming from `127.0.0.1`. There are other settings you can change to make Drupal not store copies of cached pages in the Database (since Varnish is caching everything, this is redundant), but those other settings are not covered here.
33
33
34
+
### Extending the base `drupalvm.vcl.j2` template
35
+
36
+
If you can't customize via variables because an option isn't exposed, you can extend the base `drupalvm.vcl.j2` through Jinja2 template inheritance.
_If you extend Drupal VM's provided base template, the path referenced should to be relative to the playbook.yml._
43
+
44
+
```
45
+
{% extends 'templates/drupalvm.vcl.j2' %}
46
+
47
+
{% block backend -%}
48
+
{{ super() }}
49
+
.connect_timeout = 1s;
50
+
{% endblock %}
51
+
52
+
{% block vcl_deliver -%}
53
+
unset resp.http.X-Url;
54
+
unset resp.http.X-Host;
55
+
unset resp.http.Purge-Cache-Tags;
56
+
# Do not set X-Varnish-Cache headers.
57
+
{% endblock %}
58
+
```
59
+
60
+
The `{{ super() }}` Jinja2 function returns the original block content from the base template.
61
+
34
62
For a list of available role variables, see the [`geerlingguy.varnish` Ansible role's README](https://github.com/geerlingguy/ansible-role-varnish#readme).
0 commit comments