Mark Bergsma has submitted this change and it was merged. 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. bug: 51700 Change-Id: Ieaff3fdd4d67ea76c6b8b898272e4377be759854 --- M templates/varnish/text-backend.inc.vcl.erb 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Mark Bergsma: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/varnish/text-backend.inc.vcl.erb b/templates/varnish/text-backend.inc.vcl.erb index f47b467..3483e12 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) { + set obj.http.Vary = obj.http.Vary = ",X-Forwarded-Proto"; + } else { + set 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: merged Gerrit-Change-Id: Ieaff3fdd4d67ea76c6b8b898272e4377be759854 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma <m...@wikimedia.org> Gerrit-Reviewer: Mark Bergsma <m...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits