centos7x64用squid做代理,https网站不能访问,求高手指点

不懂编程 2017-01-23 03:55:15
centos7.2,64位系统,用squid3.5做正向代理,象http://www.163.com网站可以访问,而https://www.baidu.com则不能访问,已打开端口443,80端口转发到了3128端口,3128端口已打开,请教大虾,为啥不能访问百度之类的网站???

squid.conf文件内容:

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.3.0/24 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
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 CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# 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

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access allow all

# Squid normally listens to port 3128
http_port 3128 transparent

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

cache_mem 64 MB
access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
visible_hostname 192.168.3.50


iptables文件内容:

# Generated by iptables-save v1.4.21 on Mon Jan 23 02:32:00 2017
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -s 192.168.3.0/24 -i eht0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
COMMIT
# Completed on Mon Jan 23 02:32:00 2017
# Generated by iptables-save v1.4.21 on Mon Jan 23 02:32:00 2017
*filter
:INPUT ACCEPT [44:4699]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [668:169344]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
#-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3128 -j ACCEPT
COMMIT
# Completed on Mon Jan 23 02:32:00 2017
...全文
1529 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lglli 2020-05-05
  • 打赏
  • 举报
回复
引用 6 楼 不懂编程 的回复:
[quote=引用 4 楼 wenxy1 的回复:] https默认是TCP 443 port。
443端口开了,也没用[/quote] 想问一下,你的问题找到解决办法了吗?我也遇到同样问题。
不懂编程 2017-02-13
  • 打赏
  • 举报
回复
引用 4 楼 wenxy1 的回复:
https默认是TCP 443 port。
443端口开了,也没用
nettman 2017-02-04
  • 打赏
  • 举报
回复
Wenxy1 2017-02-04
  • 打赏
  • 举报
回复
https默认是TCP 443 port。
不懂编程 2017-02-03
  • 打赏
  • 举报
回复
发现关闭了iptables,http和https都能访问,貌似是防火墙端口设置问题,等大能指点
不懂编程 2017-01-25
  • 打赏
  • 举报
回复
是个方向,研究一下
nswcfd 2017-01-25
  • 打赏
  • 举报
回复
是不是得配置https_port http://www.squid-cache.org/Doc/config/https_port/

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧