我的两个网站是www.test1.com和www.test2.com
我目前的工作configuration文件看起来像这样
/etc/squid3/squid.conf
acl test1_acl dstdomain www.test1.com acl test2_acl dstdomain www.test2.com aclSSL_ports port 443 acl Safe_ports port 80 acl Safe_ports port 21 acl Safe_ports port 443 acl Safe_ports port 70 acl Safe_ports port 210 acl Safe_ports port 1025-65535 acl Safe_ports port 280 acl Safe_ports port 488 acl Safe_ports port 591 acl Safe_ports port 777 acl CONNECT method CONNECT http_access deny !Safe_ports http_access deny CONNECT !Safe_ports http_access allow localhost manager http_access deny manager http_access allow pi1_acl http_access allow pi2_acl http_access allow localhost http_access deny all http_port 80 accel defaultsite=127.0.0.1 cache_peer 192.168.1.x parent 80 0 proxy-only name=test1 cache_peer 192.168.1.y parent 80 0 proxy-only name=test2 cache_peer_access test2 allow test2_acl coredump_dir /var/spool/squid3 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 20% 2880 refresh_pattern . 0 20% 4320
正如我所说,这个configuration工程,但我想添加一些https网站。 我尽我所能地按照这里的例子,但它已经build立了一个有点不同于他们推荐的configuration格式(或至less默认情况下它的格式)。
有关我希望转发到的https网站的更多信息:
它已经有一个.key和.crt文件,并且https正常工作。
我将.key和.crt文件复制到squid框中,并在configuration文件中引用这些文件的位置。 (不知道如果我应该离开.crt和.key文件在服务器上,但我做到了)
我还没有在服务器上做任何其他的改变…所以如果我应该这样做的话,我没有看到任何地方。
这是我的新configuration文件。
/etc/squid3/squid.conf
#new lines https_port 443 accel defaultsite=127.0.0.1 cert=/path/to/myCert.crt key=/path/to/myKey.key acl newServer_acl dstdomain www.newserver.com http_access allow newServer_acl cache_peer 192.168.1.z parent 443 0 proxy-only name=newserver ssl sslcafile=/path/to/myCert.crt #end new lines acl test1_acl dstdomain www.test1.com acl test2_acl dstdomain www.test2.com aclSSL_ports port 443 acl Safe_ports port 80 acl Safe_ports port 21 acl Safe_ports port 443 acl Safe_ports port 70 acl Safe_ports port 210 acl Safe_ports port 1025-65535 acl Safe_ports port 280 acl Safe_ports port 488 acl Safe_ports port 591 acl Safe_ports port 777 acl CONNECT method CONNECT http_access deny !Safe_ports http_access deny CONNECT !Safe_ports http_access allow localhost manager http_access deny manager http_access allow pi1_acl http_access allow pi2_acl http_access allow localhost http_access deny all http_port 80 accel defaultsite=127.0.0.1 cache_peer 192.168.1.x parent 80 0 proxy-only name=test1 cache_peer 192.168.1.y parent 80 0 proxy-only name=test2 cache_peer_access test2 allow test2_acl coredump_dir /var/spool/squid3 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 20% 2880 refresh_pattern . 0 20% 4320
这是我第一次用squid或https站点build立一个反向代理,所以我确信这是一个小错误,但我已经查看了其他configuration文件,似乎无法find问题。
任何帮助表示赞赏。
从我的研究来看,这看起来不像是一个简单的configuration文件问题。 鱿鱼必须使用--enable-ssl标志进行编译,而这对于基于Debian的发行版似乎相当困难。 在我看来,鱿鱼更适合基于RPM的发行版。 在这里看到更多的信息。
我现在要把这个标记为答案,除非有人发表了其他更有意义的东西。