繼上次的Transparent Proxy設定之後,現在又遇到了一個問題,就是不是所有的網站都是走80、8080或443 Port,很多網站尤其是管理介面都會避開一般Port,而改採8443或者其他不常使用的Port,但是這些Port在Squid裡面預設是不允許訪問的,所以我們需要調整一下squid.conf來開放這些port。

在Squid裡面,port的開放與否是由http_access這個參數來決定的,預設設定有一段如下:

# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

也就是說,只要對不屬於Safe_ports跟SSL_ports的連線埠做連線,Squid一律採取Deny的動作,而預設允許的Safe_port有這些

acl SSL_ports port 443          # https
acl SSL_ports port 563          # snews
acl SSL_ports port 873          # rsync
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl Safe_ports port 631         # cups
acl Safe_ports port 873         # rsync
acl Safe_ports port 901         # SWAT

其中Safe_ports port 1025-65535算是很寬鬆的設定,但是SSL_ports就相對來的嚴格很多,但是很多設備的管理介面的https連線通常會用8443做為連接埠,所以我們可以加上一行SSL_port的設定如下:

acl SSL_ports port 8443

然後重新啟動squid,我們就可以用https來連8443 port了

arrow
arrow
    全站熱搜

    nsysumis94 發表在 痞客邦 留言(0) 人氣()