我配置了一个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
是一个未知的标头名称……显然我遗漏了什么?
request_header_access
需要--enable-http-violations
在构建 squid 时指定。检查它的存在。更新
文档还指出:
这意味着如果一个头没有被列出,那么 squid 应该透明地传递它。
更新
如果您有一些匿名设置,那么您应该将所有“允许”规则放在“全部拒绝所有”规则之前