apachesslmod-rewriteheadervary

Remove XForward-ssl from Vary header(Apache webserver)


We have an Apache server sitting behind load balancer which is terminating SSL. For business reason we cannot disable HTTP completely . But want some of the url to redirected to https which works with below eg.

RewriteCond %{HTTP:X-Forwarded-SSL} ^on$ [NC] RewriteRule ^/url.* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

But below rule is putting xforward-ssl on vary header on every request and this is affecting caching capability. Is there we can disable Xforard-ssl from vary header from Apache response ?.


Solution

  • RewriteCond %{HTTP:X-Forwarded-SSL} ^on$ [NC,NV]

    Any one suffering from this issue you need add NV so that Vary header is not affected.