开发者社区 问答 正文

内网通过squid访问带参数网址,squid会把参数过滤掉,要怎么配置才能带参数访问?

通过内网访问带参数地址URL:http://mas.ecloud.10086.cn/app/http/authorize?ec_name=%E6%B3%B8%E5%B7%9E%E5%B8%82%E5%9B... 看squid日志TCP_MISS/200 538 GET http://mas.ecloud.10086.cn/app/http/authorize? - HIER_DIRECT squid是把参数过滤掉了,需要怎么配置才能带参数访问,squid用的3.5.2? 现在配置如下: Processing: acl localnet src 10.0.0.0/8 # RFC1918 possible internal network Processing: acl localnet src 172.16.0.0/12 # RFC1918 possible internal network Processing: acl localnet src 192.168.0.0/16 # RFC1918 possible internal network Processing: acl localnet src fc00::/7 # RFC 4193 local private network range Processing: acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines Processing: acl SSL_ports port 443 Processing: acl Safe_ports port 80 # http Processing: acl Safe_ports port 21 # ftp Processing: acl Safe_ports port 443 # https Processing: acl Safe_ports port 70 # gopher Processing: acl Safe_ports port 210 # wais Processing: acl Safe_ports port 1025-65535 # unregistered ports Processing: acl Safe_ports port 280 # http-mgmt Processing: acl Safe_ports port 488 # gss-http Processing: acl Safe_ports port 591 # filemaker Processing: acl Safe_ports port 777 # multiling http Processing: acl CONNECT method CONNECT Processing: http_access deny !Safe_ports Processing: http_access deny CONNECT !SSL_ports Processing: http_access allow localhost manager Processing: http_access deny manager Processing: http_access allow localnet Processing: http_access allow localhost Processing: http_access allow all Processing: http_port 3128 Processing: coredump_dir /var/spool/squid Processing: refresh_pattern ^ftp: 1440 20% 10080 Processing: refresh_pattern ^gopher: 1440 0% 1440 Processing: refresh_pattern -i (/cgi-bin/|?) 0 0% 0 Processing: refresh_pattern . 0 20% 4320 Initializing https proxy context

展开
收起
Tietou 2023-06-15 10:34:46 125 分享 版权
2 条回答
写回答
取消 提交回答
  • 值得去的地方都没有捷径

    这个问题可能是由于Squid的默认配置不允许带参数的URL请求,需要进行一些配置才能支持带参数的URL访问。你可以尝试在Squid配置文件中添加以下配置:

    strip_query_terms off 这个配置可以禁用Squid对URL参数的过滤,从而允许带参数的URL访问。

    另外,你也可以尝试在Squid配置文件中添加以下配置:

    query_param_encoding off 这个配置可以禁用Squid对URL参数的编码,从而允许原始参数的传递。

    注意,在修改Squid配置文件之后,你需要重新加载配置文件才能使配置生效。你可以使用以下命令来重新加载配置文件:

    sudo squid -k reconfigure 如果以上方法无效,你可以尝试升级Squid到最新版本,或者在Squid配置文件中添加更多的参数配置来解决问题。

    2023-06-15 16:46:22
    赞同 1 展开评论
  • 这个问题可能是由于 Squid 的默认配置中过滤了 URL 中的参数导致的。

    您可以尝试在 Squid 的配置文件中添加以下配置来解决这个问题:

    strip_query_terms off
    

    这个配置会禁用 Squid 对 URL 参数的过滤,从而允许带参数的 URL 地址通过 Squid 访问。将以上配置添加到 Squid 的配置文件中(通常是 /etc/squid/squid.conf),保存并重新启动 Squid 服务即可。

    另外,建议在配置 Squid 时,根据实际情况对 Squid 的缓存、访问控制等参数进行调整,以提高 Squid 的性能和安全性。

    2023-06-15 10:42:44
    赞同 2 展开评论
问答分类:
问答地址: