wget www.google美国服务器.com -e use_proxy=yes -e http_proxy=http://127.0.0.1:3128
squid 配置里加了intercept没?http://www.squid-cache.org/Doc/config/http_port/
3128是谁在listen?
是bind0.0.0.0还是只bind本地?
bind全部interface试试,如果行的话再做讨论。
另外iptables filter表有打开3128端口么?redirect之后就不是允许80而是允许3128了。filter表在nat表之后
破头像害我点了两次
iptables -t nat -A => iptables -t nat -I
好吧,我做了测试,貌似如果直接
iptables -A INPUT -s 192.168.251.0/24 -p tcp --dport 3128 -j ACCEPT,
然后让Nginx听全部端口的话就可以连接了
再然后我看了一眼Nginx的日志:
192.168.251.46 - - [18/Jun/2015:02:16:35 -0400] "GET /m/gne/suggest/v2?q=http%3A%2F%2Fportquiz.net%2Fddd.avi&hl=zh-CN&app=iss&appv=141338691&platform=android&pff=1&feeds=qs,ns HTTP/1.1" 404 151 "-" "Android/1.0 (umts_everest I.7.1-45)"
192.168.251.46....
(唔脸,原来真相是这样……
是这样的
某些系统内核禁止其他端口转发到lo,而且你也没有redirect 到127.0.0.1
源是外面的IP并没有错
DNAT工作方法就是这样:直接改包头
其实如果你如果是劫持,而且网站比较多的话还是建议squid比较方便