2016-08-12 279 views
0

我目前正試圖通過代理來遏制網站。 我使用Squid設置代理服務器。 我的squid.conf的配置是:代理服務器上的cUrl返回狀態200,cUrl通過代理返回403

acl allowed_ip src xxx.xxx.xxx.xxx (ip of the other server) 
http_access allow allowed_ip 
http_access deny all 

當我ssh我的代理服務器上,我可以這樣做:

curl http://www.submarino.com.br -i 

,我也得到:

HTTP/1.1 200 OK 
Content-Type: text/html;charset=UTF-8 
Server: Apache-Coyote/1.1 
X-Powered-By: JSF/1.2 
x-tid: CATALOGO-05ada7f1-ed40-4192-b487-47e658111844 
Cache-Control: max-age=698 
Expires: Fri, 12 Aug 2016 18:48:49 GMT 
Date: Fri, 12 Aug 2016 18:37:11 GMT 
Transfer-Encoding: chunked 
Connection: keep-alive 
Connection: Transfer-Encoding 
Set-Cookie: MobileOptOut=1; path=/; domain=submarino.com.br 
Set-Cookie: b2wChannel=INTERNET; path=/; domain=submarino.com.br 
Vary: Accept-Encoding, User-Agent 

但如果我嘗試捲曲通過我的其他服務器,使用:

curl 'http://www.submarino.com.br' --proxy 128.199.209.72:3128 -v 

我得到:

* Rebuilt URL to: http://www.submarino.com.br/ 
* Hostname was NOT found in DNS cache 
* Trying xxx.xxx.xxx.xx... 
* Connected to xxx.xxx.xxx.xx (xxx.xxx.xxx.xx) port xxxx (#0) 
> GET http://www.submarino.com.br/ HTTP/1.1 
> User-Agent: curl/7.35.0 
> Host: www.submarino.com.br 
> Accept: */* 
> Proxy-Connection: Keep-Alive 
> 
< HTTP/1.1 403 Forbidden 
* Server AkamaiGHost is not blacklisted 
< Server: AkamaiGHost 
< Mime-Version: 1.0 
< Content-Type: text/html 
< Content-Length: 274 
< Expires: Fri, 12 Aug 2016 18:31:16 GMT 
< Date: Fri, 12 Aug 2016 18:31:16 GMT 
< Set-Cookie: MobileOptOut=1; path=/; domain=submarino.com.br 
< Set-Cookie: b2wChannel=INTERNET; path=/; domain=submarino.com.br 
< Vary: Accept-Encoding, User-Agent 
< X-Cache: MISS from ubuntu-512mb-sgp1-01 
< X-Cache-Lookup: MISS from ubuntu-512mb-sgp1-01:3128 
< Via: 1.1 ubuntu-512mb-sgp1-01 (squid/3.5.12) 
< Connection: keep-alive 
< 
* Connection #0 to host ----------- left intact 

從結果看來,我通過代理連接。沒有代理時捲曲時,我會得到相同的結果。任何人都可以請解釋一下這個?

UPDATE:

我設置基本身份驗證我的代理,但錯誤是一樣的。我可以連接到代理服務器,但在給定的URL(www.submarino.com.br)上curl失敗。 其他網址工作正常。

我試圖通過我的本地主機上的相同代理捲曲。

GET http://www.submarino.com.br/ HTTP/1.1 
> Host: www.submarino.com.br 
> Proxy-Authorization: Basic cHJvbW9jb246cHJvbW9jb25ieWdlbmV6emkyMDE2 
> User-Agent: curl/7.47.0 
> Accept: */* 
> Proxy-Connection: Keep-Alive 
> 
< HTTP/1.1 200 OK 

而我的服務器上

Proxy auth using Basic with user 'xxxxxx' 
> GET http://www.submarino.com.br/ HTTP/1.1 
> Proxy-Authorization: Basic cHJvbW9jb246cHJvbW9jb25ieWdlbmV6emkyMDE2 
> User-Agent: curl/7.35.0 
> Host: www.submarino.com.br 
> Accept: */* 
> Proxy-Connection: Keep-Alive 
> 
< HTTP/1.1 403 Forbidden 

基本上他們的時候我也不代理捲曲請求工作一樣。

回答

0

你的魷魚代理主機拒絕請求。您可能需要使用代理進行身份驗證。

+0

實際上,如果直接在我的普通服務器上捲曲到該網址,則會得到此響應。我說「連接到xxx.xxx.xxx.xx(xxx.xxx.xxx.xx)端口xxxx(#0)」。我只是爲了隱私目的而將這個IP地址xxx。 – pcezar91