从 Vary header(Apache 网络服务器)中删除 XForward-ssl

Remove XForward-ssl from Vary header(Apache webserver)

我们有一个 Apache 服务器位于正在终止 SSL 的负载平衡器后面。出于商业原因,我们不能完全禁用 HTTP。但是希望将某些 url 重定向到 https,它适用于下面的示例。

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

但下面的规则是在每个请求上将 xforward-ssl 设置为 vary header,这会影响缓存能力。我们可以从 Apache 响应中禁用 Xforard-ssl from vary header 吗?

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

任何遇到此问题的人都需要添加 NV,以便 Vary header 不受影响。