Web Services Squid问题-需要代理身份验证

vwhgwdsa  于 2022-11-15  发布在  其他
关注(0)|答案(1)|浏览(142)

我有一个Web请求,使用代理(正向代理)到网站,比如说www.example.com这个网站有反向代理(Squid),结果我所有的请求都作为MISS返回。有没有办法使用正向代理和检索数据?
请理解,我是一个新手在这方面。
阅读了一段时间后,我设置没有兑现,这是我得到的
这是请求

Command: GET
URI: http://www.example.com
ProtocolVersion: HTTP/1.1
UserAgent:  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Referer:  http://www.example.com
Accept:  */*
Accept-Charset:  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding:  gzip,deflate
Accept-Language:  en-us,en;q=0.5
Keep-Alive:  115
X-Requested-With:  XMLHttpRequest
X-Prototype-Version:  1.7
Expires:  Sun, 19 Nov 1978 05:00:00 GMT
Host:  www.example.com
Cookie:  
  PHPSESSID: 249477191de6048739cd8690fabd6060
  UTG: A-3345389704b26912f6d5422.73487509-0a3a0a26a100a113a119a24a1a4a77a7a6a      
  addOtr: 7L4L2
  CLIENT_WIDTH: 1916
  MAIN_WIDTH: 1726

Cache-Control:  no-store,no-cache
Pragma:  no-cache
ProxyConnection:  Keep-Alive
HeaderEnd: CRLF

这是回应

ProtocolVersion: HTTP/1.0
StatusCode: 407, Proxy authentication required
Reason: Proxy Authentication Required
Server:  squid/3.0.STABLE19
Mime-Version:  1.0
Date:  Mon, 31 Jan 2011 19:04:44 GMT
ContentType:  text/html
ContentLength:  2986
X-Squid-Error:  ERR_CACHE_ACCESS_DENIED 0
ProxyAuthenticate: Basic realm="Anonymous proxy"
Authenticate:  Basic realm="Anonymous proxy"
X-Cache:  MISS from funky
X-Cache-Lookup:  NONE from funky:2448
Via:  1.0 funky (squid/3.0.STABLE19)
ProxyConnection:  close
HeaderEnd: CRLF

先谢了

oaxa6hgo

oaxa6hgo1#

您需要将过期时间设置为将来。
尝试将Expires、Cache-Control和Pragma更改为如下所示:
高速缓存控制:最长生存期=300日期:2011年2月4日星期五04:52:58 GMT过期:2011年2月4日星期五04:57:58 GMT...
(移除Pragma。您可以编辑.htaccess档案来移除Pragma)

相关问题