The client cannot access the Squid reverse proxy server when the Squid reverse proxy is configured

Article Directory


1. Phenomenon

The environment configuration is as follows, this is a small experiment, for reference only:

Host CPU name operating system IP address Main software
Squid-Server CentOS 7-5 CentOS 7 192.168.126.15 squid-3.5.28.tar.gz
Web1 CentOS 7-4 CentOS 7 192.168.126.14 httpd
Web2 CentOS 7-3 CentOS 7 192.168.126.13 httpd
Client Win10 Windows 192.168.126.10 /
  • After configuring Squid-Server and two web servers, the hosts domain name resolution and proxy server settings of the Win10 client have been modified.
  • However, in the last step, the Win10 client failed to access the IP server of the Squid reverse proxy server and failed to obtain the web pages of the two web servers.

Two, solve

  • First of all, have you turned off all this?
systemctl stop firewalld
systemctl disable firewalld
setenforce 0

#防火墙:呵呵,没想到吧
  • Test the network, Ping Baidu on the Squid reverse proxy server, and whether the two web servers can communicate normally
  • Check whether the network card configuration of each server is normal, and whether the gateway is commented out
  • Then, check whether each key service starts normally
Squid:
systemctl stop httpd
#关闭 httpd 服务,以防止冲突
systemctl restart squid
netstat -natp | grep "squid"

Web:
systemctl restart httpd
netstat -natp | grep "httpd"
  • Then check whether the Squid-Server configuration file is completely correct!
vim /etc/squid.conf
#这里截取比较关键的一部分,以供参考

mark

iptables -F
iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
iptables -L INPUT
  • This is how I checked and tossed several times, and finally the reverse proxy was successful. Win10 client can successfully access the IP address of the proxy server, and the web pages of the two websites are displayed normally.

Guess you like

Origin blog.csdn.net/weixin_51486343/article/details/114038687