Skip to content

Commit de45880

Browse files
authored
Merge pull request #161 from EmersonPrado/Issue_122_deliver
[Issue #122] Add prepend and append sections for sub vcl_deliver
2 parents 60790cd + 2e662c3 commit de45880

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

templates/varnish4-vcl.erb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ sub vcl_recv {
3434
<%- end -%>
3535
<%- if @logrealip -%>
3636
if (req.http.X-Forwarded-For) {
37-
std.log("RealIP:" + req.http.X-Forwarded-For);
37+
std.log("RealIP:" + req.http.X-Forwarded-For);
3838
} else {
39-
std.log("RealIP:" + client.ip);
39+
std.log("RealIP:" + client.ip);
4040
}
4141
<%- end -%>
4242

@@ -64,7 +64,7 @@ sub vcl_recv {
6464
# Static file cache
6565
((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)$")||
6666
# Plone images cache
67-
(req.url ~ "(?i)(image|imagem_large|image_preview|image_mini|image_thumb|image_tile|image_icon|imagem_listing)$")) &&
67+
(req.url ~ "(?i)(image|imagem_large|image_preview|image_mini|image_thumb|image_tile|image_icon|imagem_listing)$")) &&
6868
# Plone resource editor
6969
(req.url !~ "(?i)\@\@plone\.resourceeditor\.getfile\?path\=")
7070
<%- end -%>
@@ -107,7 +107,7 @@ sub vcl_recv {
107107
return (synth(405, "Not allowed."));
108108
}
109109
ban(" req.url == " + req.url);
110-
set req.url = regsuball(req.url,"80","443");
110+
set req.url = regsuball(req.url,"80","443");
111111
set req.url = regsuball(req.url,"http","https");
112112
ban(" req.url == " + req.url);
113113
# Throw a synthetic page so the
@@ -230,6 +230,9 @@ sub vcl_deliver {
230230
<%- if @functions['vcl_deliver'] -%>
231231
<%= @functions.delete('vcl_deliver') %>
232232
<%- else -%>
233+
<%- if @functions['vcl_deliver_prepend'] -%>
234+
<%= @functions.delete('vcl_deliver_prepend') %>
235+
<%- end -%>
233236
if (obj.hits > 0) {
234237
set resp.http.X-Cache = "HIT";
235238
} else {
@@ -247,6 +250,9 @@ sub vcl_deliver {
247250
}
248251
<%-end-%>
249252
<%-end-%>
253+
<%- if @functions['vcl_deliver_append'] -%>
254+
<%= @functions.delete('vcl_deliver_append') %>
255+
<%- end -%>
250256
<%-end-%>
251257
}
252258

0 commit comments

Comments
 (0)