Mark Bergsma has uploaded a new change for review.

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


Change subject: Fix up Vary headers on 30x redirects from Apache
......................................................................

Fix up Vary headers on 30x redirects from Apache

Apache on the application servers is not properly configured to send
Vary: X-Forwarded-Proto headers when sending redirects. Squid seems
to not cache the 30x responses, but Varnish does, and until we fix
the Apache configuration we need to fix it up manually.

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/75583/1

diff --git a/templates/varnish/text-backend.inc.vcl.erb 
b/templates/varnish/text-backend.inc.vcl.erb
index f47b467..ef28257 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -31,6 +31,15 @@
 }
 
 sub vcl_fetch {
+       /* FIXME: Fix up missing Vary headers on Apache redirects */
+       if ((obj.status == 301 || obj.status == 302) && obj.http.Location ~ 
"^http" && obj.http.Vary !~ "X-Forwarded-Proto") {
+               if (obj.http.Vary) {
+                       obj.http.Vary = obj.http.Vary = ",X-Forwarded-Proto"
+               } else {
+                       obj.http.Vary = "X-Forwarded-Proto"
+               }
+       }
+
        return (deliver);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaff3fdd4d67ea76c6b8b898272e4377be759854
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