让 Squid 传递 X-Requested-With 标头

让 Squid 传递 X-Requested-With 标头

我已经配置了squid 3.1代理服务器。
除了标头之外,其他一切都很好X-Requested-With
我不知道如何将该标头传递给我尝试通过代理打开的站点。

这是我当前的配置:

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Cookie allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access User-Agent allow all
request_header_access All deny all #remove all other headers


# delete "x-forwarder-for.." headers
forwarded_for delete
request_header_access Via deny all
request_header_access X-Forwarded-For deny all

我试图将此行添加request_header_access X-Requested-With allow all到配置中,但显然X-Requested-With是一个未知的标题名称...显然我遗漏了什么?

答案1

request_header_access构建 squid 时需要--enable-http-violations指定。检查它是否存在。

更新

此外文档状态:

默认情况下,允许所有标题(不执行匿名化)。

这意味着如果某个标头未列出,则 squid 应该透明地传递它。

更新

如果你设置了一些匿名设置,那么你应该把所有“允许”规则放在“全部拒绝全部”规则之前

相关内容