GWicke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/258498

Change subject: Make /api/rest_v1/ work for test.wikipedia.org
......................................................................

Make /api/rest_v1/ work for test.wikipedia.org

RESTBase does not currently work at test.wikipedia.org, as any request to this
domain (or with the X-Wikimedia-Debug header set) is sent to the
test_wikipedia backend. This patch narrows this down to exclude /api/rest_v1/
matches.

Change-Id: I1c1881b8bc4e5d261ae771d6bfffecbfd7e3947e
---
M templates/varnish/text-backend.inc.vcl.erb
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/98/258498/1

diff --git a/templates/varnish/text-backend.inc.vcl.erb 
b/templates/varnish/text-backend.inc.vcl.erb
index 8a9fc55..052a7c2 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -16,13 +16,13 @@
                set req.backend = api;
        } else if (req.url ~ "^/w/thumb(_handler)?\.php") {
                set req.backend = rendering;
-       } else if (req.url ~ "^/api/rest_v1/") {
+       }
+               
+       if (req.url ~ "^/api/rest_v1/") {
                set req.url = "/" + req.http.host + regsub(req.url, 
"^/api/rest_v1/", "/v1/");
                set req.backend = restbase_backend;
-       }
-
-
-       if (req.http.X-Wikimedia-Debug == "1") {
+       } else if (req.http.X-Wikimedia-Debug == "1") {
+               // Note: Make sure only MW core traffic is sent to this backend.
                set req.backend = test_wikipedia;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c1881b8bc4e5d261ae771d6bfffecbfd7e3947e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: GWicke <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to