BBlack has submitted this change and it was merged.

Change subject: support geoiplookup target on all enabled clusters
......................................................................


support geoiplookup target on all enabled clusters

This enables support for both the /geoiplookup path and the geoiplookup.wm.o
hostname on all clusters with the enable_geoiplookup attribute.  Previously
this only existed on bits.wm.o, but this brings it to the text/mobile
endpoints as well.

Change-Id: I8c90977e4937838451c6b09bacb5667cafe44ae9
---
M modules/varnish/templates/vcl/wikimedia.vcl.erb
1 file changed, 17 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/modules/varnish/templates/vcl/wikimedia.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia.vcl.erb
index 5512c91..da555eb 100644
--- a/modules/varnish/templates/vcl/wikimedia.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia.vcl.erb
@@ -306,6 +306,12 @@
                error 204;
        }
 
+<% if @cluster_options.fetch("enable_geoiplookup", false) -%>
+       if (req.url == "/geoiplookup" || req.http.host == 
"geoiplookup.wikimedia.org") {
+               error 666 "geoiplookup";
+       }
+<% end -%>
+
        /* Function vcl_recv in <%= @vcl %>.inc.vcl will be appended here */
 }
 
@@ -399,6 +405,17 @@
        if (obj.status == 204 && req.request == "PURGE") {
                set obj.http.Connection = "keep-alive";
        }
+
+<% if @cluster_options.fetch("enable_geoiplookup", false) -%>
+       // Support geoiplookup
+       if (obj.status == 666) {
+               call geoip_lookup;
+               set obj.status = 200;
+               set obj.http.Connection = "keep-alive";
+               return (deliver);
+       }
+<% end -%>
+
        /* Function vcl_error in <%= @vcl %>.inc.vcl will be appended here */
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/209173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c90977e4937838451c6b09bacb5667cafe44ae9
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to