Skip to content

Commit

Permalink
Merge pull request #99 from collective/vcl_synth
Browse files Browse the repository at this point in the history
vcl_synth
  • Loading branch information
fredvd authored Mar 28, 2024
2 parents cdc23d2 + 50f68e6 commit 3ac058a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
6.0.12 (unreleased)
-------------------

- Nothing changed yet.
- Add vcl_synth options to insert arbitrary vcl.
[mamico]


6.0.11 (2023-08-18)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ These options are available for the recipe part plone.recipe.varnish:configurati
Specifies hostnames or IP addresses for purge ACL. By default ``localhost`` and
the backends are allowed to purge. Additional allowed hosts are listed here.

``vcl_recv``, ``vcl_hit``, ``vcl_miss``, ``vcl_backend_fetch``, ``vcl_backend_response``, ``vcl_deliver``, ``vcl_pipe``, ``vlc_purge``, ``vcl_hash``, ``vcl_import``, ``vcl_init``, ``vcl_pass``
``vcl_recv``, ``vcl_hit``, ``vcl_miss``, ``vcl_backend_fetch``, ``vcl_backend_response``, ``vcl_deliver``, ``vcl_pipe``, ``vlc_purge``, ``vcl_hash``, ``vcl_import``, ``vcl_init``, ``vcl_pass``, ``vcl_synth``
Insert arbitrary VCL code into the generated config.

``verbose-headers``
Expand Down
1 change: 1 addition & 0 deletions plone/recipe/varnish/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def create_varnish_configuration(self):
"vcl_pipe",
"vcl_backend_response",
"vcl_hash",
"vcl_synth",
):
config["custom"][name] = self.options.get(name, "")

Expand Down
1 change: 1 addition & 0 deletions plone/recipe/varnish/templates/varnish6.vcl.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ sub vcl_deliver {
We can come here "invisibly" with the following errors: 413, 417 & 503
*/
sub vcl_synth {
{{custom['vcl_synth']}}
set resp.http.Content-Type = "text/html; charset=utf-8";
set resp.http.Retry-After = "5";

Expand Down

0 comments on commit 3ac058a

Please sign in to comment.