Squid 可以工作,但是无法提供页面

Squid 可以工作,但是无法提供页面

我有一个鱿鱼(v4.8)安装在虚拟机上,我们称之为路由器,这台机器可以连接到互联网和内部网络,从而连接到另一台虚拟机,贮存

我想乌贼到:

  • 充当缓存代理,并且
  • 在转发和透明模式下工作。

我还没有读过任何人做过同样的事情,但我见过一些 squid 配置,其中指定了多个端口来监听,并且其中至少一个可以具有截距开关。我不得不说我还有另一个接口(仅主机)连接路由器主持人(实际机器),此界面仅用于测试一些功能。

事实:

  1. 使用网络浏览器主持人
    • 我被要求输入凭证
    • 如果我输入了错误的凭证,系统会再次询问我
    • 如果我输入正确的,它就会继续
      • 如果我尝试访问不在白名单上的网页,我会看到 squid 横幅
      • 如果我尝试访问允许的网页……它只会继续加载而不显示任何内容
  2. 使用内部命令行应用程序贮存
    • 如果我尝试检索黑页(不在白名单上)我得到:
      • HTML 网页包含拒绝访问curl <webpage> -o <file>
      • 包含以下内容的文本文件错误 403:禁止访问wget <webpage> -o <file>
      • 在这两种情况下我都得到access.logTCP_DENIED/403尺寸获取 http://黑网址- HIER_NONE/-以及cache.log注意:身份验证不适用于拦截的请求。
    • 如果我尝试检索白页(在白名单上) 它一直在“加载”。当我退出时 ( ^C) 我看到access.logNONE_ABORTED/000 0 获取 http://白色网址- HIER_NONE/- -什么也没有cache.log
    • 發行curl -x "http://user:pass@domain:8080" <url>
      • 如果凭证不正确,我会得到一个 HTML 文件,其中包含缓存访问被拒绝。 文件access.logTCP_DENIED/407尺寸获取 http://网址 用户HIER_NONE/- 文本/html什么也没有cache.log
      • 如果凭证正确:
        • 黑名单页面:我确实明白了。文件access.logTCP_MISS/200尺寸获取 http://黑网址 用户HIER_DIRECT/ipurl(或者TCP_REFRESH_MODIFIED)并且没有任何内容cache.log
        • 白名单页面:我无法获取任何内容,当我中止时,我得到了access.logTCP_MISS_ABORTED/000 0 获取 http://白色网址- HIER_NONE/- -,什么也没有cache.log
        • 注意:我错误地尝试获取导致我重定向的页面,因此我得到了301 永久移动。 文件access.logTCP_MISS/301尺寸获取 http://白页- HIER_DIRECT/ipurl并且什么也没有cache.log
        • 注:上一页是我的白名单
        • 注意:如果我使用凭证请求禁止访问的页面,它总是出现在 URL 的末尾。

我的 squid 配置文件(/etc/squid/squid.conf):

http_port 8080
http_port 3128 intercept
dns_nameservers 127.0.0.1 1.1.1.1 # Sometimes squid doesn't load the nameserver from /etc/resolv.conf
# Storage
cache_dir ufs /var/cache/squid 3000 16 256
maximum_object_size 250 MB
refresh_pattern -i ".+\.(mp4|mkv|webm|iso)$" 0 20% 2880
# Authentication
auth_param basic program /usr/lib/squid/basic_db_auth \
  --user "user" --password "pass" \
  --table "table" --usercol "userinsomelang" --passwdcol "passinsomelang" --md5 \
  --persist
auth_param basic children 10
auth_param basic realm "Squid proxy"
auth_param basic credentialsttl 1 hour
auth param basic casesensitive on
# ACL lists
acl whitedomain srcdomain .mydomain.com
acl whitehosts src "/etc/squid/files/whitehosts.list"
acl whitesites dstdomain "/etc/squid/files/whitesites.list"
acl blocksites dstdomain "/etc/squid/files/blacksites.list"
acl blockurl url_regex -i "/etc/squid/files/block_url.list"
acl worktime time M-F 8:00-17:00
acl worktime time HF 18:00-23:00
acl safeports port 80
acl safeports port 443
acl safeports port 1025-65535
acl db_auth proxy_auth REQUIRED
acl CONNECT method CONNECT  # I have no idea what this is for
# Actions
http_access deny blockurl
http_access allow whitesites
http_access allow wortime
http_access deny !safeports
http_access allow db_auth whitehosts
http_access deny all

我认为我的iptables配置路由器不需要,你可以发现它与这些日志配合得很好。而且我正在使用最低限度来检查它不是因为它。

我也做了一些数据包嗅探,我可以看到来自内部网络的数据包,从我的外部网卡传出的数据包和传入的数据包(名称解析与所询问的页面相关),就是这样。

因此,我发现有两个主要问题,而且可能还有更多:

  1. 我无法获取白名单页面(透明或转发模式)。
  2. 我可以使用正确的凭据获取黑名单页面,但只能从命令行获取,无法通过我的网络浏览器实现这一点。

我该如何修复这个问题?为什么它会这样工作?

相关内容