【问题标题】:Allow access to localhost from localhost by Squid允许 Squid 从 localhost 访问 localhost
【发布时间】:2015-10-16 11:28:27
【问题描述】:

我在本地运行 Squid,我想通过 Squid 在 localhost:3000 上运行的 Ruby 服务器访问。

如果我尝试访问 localhost:3000,我会收到以下消息:

The following error was encountered while trying to retrieve the URL:
http://localhost:3000/

Access Denied.

Access control configuration prevents your request from being allowed
at this time.

如何配置 Squid 以允许从 localhost 访问 localhost? 我已将此行从拒绝更新为允许:http_access allow to_localhost

【问题讨论】:

    标签: squid


    【解决方案1】:

    必须为 localhost 或 127.0.0.0/8 添加例外以直接连接而无需代理。例如在 Firefox 中:首选项 -> 高级 -> 网络 -> 设置 -> 无代理。

    或者使用环境变量no_proxy

    export no_proxy=localhost,127.0.0.0/8
    

    我的系统范围设置在/etc/environment

    http_proxy=http://172.16.0.253:3128/
    https_proxy=http://172.16.0.253:3128/
    no_proxy=localhost,127.0.0.0/8
    

    【讨论】:

      【解决方案2】:

      转到: SquidMan > 首选项 > 模板 并评论这些行:

      #Deny requests to certain unsafe ports
      #http_access deny !Safe_ports
      
      #Deny CONNECT to other than secure SSL ports
      #http_access deny CONNECT !SSL_ports
      

      或者,您可以在这些行下方的 acl 端口列表中将此端口列入白名单。

      如果这无助于确保您在网络 > 高级 > 代理中正确添加绕过代理(localhost 或 127.0.0.1)。

      在我的情况下,此绕过代理每 2-3 分钟就会消失一次。 (我不知道如何解决它)

      【讨论】:

        【解决方案3】:

        也许不是最性感的解决方案,但我解决了 设置Ngrok tunell $ ./ngrok http 3128

        现在我可以通过 identifier.ngrok.com 访问 Squid

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2015-02-05
          • 2017-03-19
          • 2018-02-07
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-11-27
          • 2013-02-14
          相关资源
          最近更新 更多