odania 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/odania/version.rb +1 -1
- data/templates/varnish/site_assets.vcl.erb +16 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d869250e9939f0bd3314c657810dfa7f54c0492
|
|
4
|
+
data.tar.gz: 83cd00c003898d412f13c10caaf5071d3094f583
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5eada7c634669f18bb2e0687c986eda0e6a88e91c1f01f22099f83bb5d65c314112a3bfcf9b417b21b4e228d520a2406459f3bd7b6b47610bf01946faa6a4c6
|
|
7
|
+
data.tar.gz: e9d540901337d77fbaf3c513ed0910e43933a36dfd98ff2f2170c809538e96aaf9af0a5473803994f1221d0620e5d26cc45e6d1d8fb4f46136c340406723cd9c
|
data/Gemfile.lock
CHANGED
data/lib/odania/version.rb
CHANGED
|
@@ -10,8 +10,10 @@ sub vcl_recv {
|
|
|
10
10
|
if (req.http.host ~ "<%= domain.name %>$") {
|
|
11
11
|
std.log("varnish log info '<%= domain.name %>':" + req.http.host);
|
|
12
12
|
|
|
13
|
+
# subdomains
|
|
13
14
|
<% domain.subdomains.each_pair do |subdomain_name, subdomain| %>
|
|
14
|
-
<%
|
|
15
|
+
<% next if '_general'.eql? subdomain_name %>
|
|
16
|
+
<%= is_first ? '' : 'else ' %>if (req.http.host ~ "^<%= subdomain.name %>.<%= domain.name %>$") {
|
|
15
17
|
std.log("subdomain identified '<%= subdomain.name %>.<%= domain.name %>':" + req.http.host + " url: " + req.url );
|
|
16
18
|
|
|
17
19
|
<% subdomain.assets.each_pair do |url, page| %>
|
|
@@ -25,10 +27,21 @@ sub vcl_recv {
|
|
|
25
27
|
}
|
|
26
28
|
<% end %>
|
|
27
29
|
|
|
28
|
-
<% unless '_general'.eql? subdomain_name %>
|
|
29
30
|
}
|
|
30
31
|
<% is_first = false %>
|
|
31
|
-
|
|
32
|
+
<% end %>
|
|
33
|
+
|
|
34
|
+
# general
|
|
35
|
+
<% subdomain = domain.subdomain('_general') %>
|
|
36
|
+
<% subdomain.assets.each_pair do |url, page| %>
|
|
37
|
+
if (req.url ~ "^<%= prepare_url url %>") {
|
|
38
|
+
std.log("page identified '<%= subdomain.name %>.<%= domain.name %>' Page:'<%= url %>':" + req.url);
|
|
39
|
+
|
|
40
|
+
set req.backend_hint = <%= page.director %>.backend();
|
|
41
|
+
<% unless page.plugin_url.nil? %>set req.url = "<%= page.plugin_url %>";<% end %>
|
|
42
|
+
|
|
43
|
+
return (hash);
|
|
44
|
+
}
|
|
32
45
|
<% end %>
|
|
33
46
|
}
|
|
34
47
|
}
|