diff --git a/templates/varnish4-vcl.erb b/templates/varnish4-vcl.erb index 794b244..7f87716 100644 --- a/templates/varnish4-vcl.erb +++ b/templates/varnish4-vcl.erb @@ -34,9 +34,9 @@ sub vcl_recv { <%- end -%> <%- if @logrealip -%> if (req.http.X-Forwarded-For) { - std.log("RealIP:" + req.http.X-Forwarded-For); + std.log("RealIP:" + req.http.X-Forwarded-For); } else { - std.log("RealIP:" + client.ip); + std.log("RealIP:" + client.ip); } <%- end -%> @@ -64,7 +64,7 @@ sub vcl_recv { # Static file cache ((req.url ~ "(?i)\.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|kss|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm|jar|class|flv|exe)$")|| # Plone images cache - (req.url ~ "(?i)(image|imagem_large|image_preview|image_mini|image_thumb|image_tile|image_icon|imagem_listing)$")) && + (req.url ~ "(?i)(image|imagem_large|image_preview|image_mini|image_thumb|image_tile|image_icon|imagem_listing)$")) && # Plone resource editor (req.url !~ "(?i)\@\@plone\.resourceeditor\.getfile\?path\=") <%- end -%> @@ -107,7 +107,7 @@ sub vcl_recv { return (synth(405, "Not allowed.")); } ban(" req.url == " + req.url); - set req.url = regsuball(req.url,"80","443"); + set req.url = regsuball(req.url,"80","443"); set req.url = regsuball(req.url,"http","https"); ban(" req.url == " + req.url); # Throw a synthetic page so the @@ -230,6 +230,9 @@ sub vcl_deliver { <%- if @functions['vcl_deliver'] -%> <%= @functions.delete('vcl_deliver') %> <%- else -%> +<%- if @functions['vcl_deliver_prepend'] -%> + <%= @functions.delete('vcl_deliver_prepend') %> +<%- end -%> if (obj.hits > 0) { set resp.http.X-Cache = "HIT"; } else { @@ -247,6 +250,9 @@ sub vcl_deliver { } <%-end-%> <%-end-%> + <%- if @functions['vcl_deliver_append'] -%> + <%= @functions.delete('vcl_deliver_append') %> + <%- end -%> <%-end-%> }