Mark Bergsma has uploaded a new change for review.

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


Change subject: Do XFF appends, use pass for POST requests
......................................................................

Do XFF appends, use pass for POST requests

Change-Id: Icf85552e900080c077eff78485ad1db0973e5808
---
M templates/varnish/text-backend.inc.vcl.erb
M templates/varnish/text-frontend.inc.vcl.erb
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/75587/1

diff --git a/templates/varnish/text-backend.inc.vcl.erb 
b/templates/varnish/text-backend.inc.vcl.erb
index 5ed6291..53c6ea9 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -4,6 +4,7 @@
 include "text-common.inc.vcl";
 
 sub vcl_recv {
+       call vcl_recv_append_xff;
        call vcl_recv_purge;
        call restrict_access;
 
@@ -22,7 +23,11 @@
        } else if (req.url ~ "^/w/thumb(_handler)?\.php") {
                set req.backend = rendering;
        }
+
 <% end -%>
+       if (req.request != "GET" && req.request != "HEAD") {
+               return (pass);
+       }
        return(lookup);
 }
 
diff --git a/templates/varnish/text-frontend.inc.vcl.erb 
b/templates/varnish/text-frontend.inc.vcl.erb
index 797f7c5..2975a51 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -19,6 +19,8 @@
 }
 
 sub vcl_recv {
+       call vcl_recv_append_xff;
+
        /* Allow purging */
        call vcl_recv_purge;
 
@@ -40,6 +42,9 @@
                unset req.http.If-Modified-Since;
        }
 
+       if (req.request != "GET" && req.request != "HEAD") {
+               return (pass);
+       }
        return(lookup);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf85552e900080c077eff78485ad1db0973e5808
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma <m...@wikimedia.org>

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

Reply via email to