Squid가 웹페이지를 잘못 로드합니다.

Squid가 웹페이지를 잘못 로드합니다.

간단한 HTTP 프록시로 작동하도록 VPS 서버를 구성하려고 합니다. CentOS 7.1.1503에 Squid 3.3.8을 설치하고 ncsa_auth. 전체 구성표가 작동하는 것 같고 다른 PC에서 내 프록시에 성공적으로 연결하고 있지만 이제 웹페이지 로딩 문제에 직면하고 있습니다. 예를 들어 열려고 할 때http://mirrors.liquidweb.com/, 웹페이지가 올바르게 로드되지 않습니다. Firefox는 페이지의 절반만 로드한 후 잠시 동안 "liquidweb.com에서 데이터 전송 중"이라는 메시지가 표시됩니다. 그러면 아무 결과도 없이 사라집니다. 웹페이지는 여전히 절반만 로드된 상태로 표시됩니다. 이 문제에 대해 약간의 조사를 했지만 제가 찾을 수 있는 유일한 해결책은 DNS 문제와 관련된 것이었습니다. DNS 관련 문제는 아닌 것 같고 dns_v4_first on오징어 구성에 옵션을 추가해도 아무런 결과가 나오지 않았습니다. 특히 이 문제는 사이트나 브라우저 관련 문제가 아니라는 점을 지적하고 싶습니다. 웹 사이트를 열려고 시도한 모든 브라우저에 이 문제가 나타났고, 브라우저 설정에서 프록시를 비활성화하면 문제가 즉시 해결되기 때문입니다. 또한 이 프록시를 통해 평균 속도 ~50Mbps로 파일을 다운로드할 수 있으므로 ISP 관련 문제는 아닌 것 같습니다. 저 squid.conf와 부적절하게 로드된 웹페이지가 포함된 스크린샷이 아래에 있습니다. 추측해 주셔서 미리 감사드립니다!

auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic childred 5
auth_param basic realm liproxy
auth_param basic credentialsttl 2 hours

#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.0.0/16    # 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

http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

http_access allow localhost manager
http_access deny manager

#http_access deny to_localhost

acl ncsaauth proxy_auth REQUIRED
http_access allow ncsaauth
dns_v4_first on

http_access deny all

http_port 0.0.0.0:3128

#cache_dir ufs /var/spool/squid 100 16 256

coredump_dir /var/spool/squid

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

etc/sysconfig/iptables

*filter

# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allows all outbound traffic
# You could modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

-A INPUT -p tcp --dport 3128 -j ACCEPT

# Allows SSH connections 
# The --dport number is the same as in /etc/ssh/sshd_config
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Now you should read up on iptables rules and consider whether ssh access 
# for everyone is really desired. Most likely you will only allow access from certain IPs.

# Allow ping
#  note that blocking other types of icmp packets is considered a bad idea by some
#  remove -m icmp --icmp-type 8 from this line to allow all kinds of icmp:
#  https://security.stackexchange.com/questions/22711
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# log iptables denied calls (access via 'dmesg' command)
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Reject all other inbound - default deny unless explicitly allowed policy:
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT

여기에 이미지 설명을 입력하세요

답변1

인터넷 어딘가에서 방화벽을 복사했지만 완전히 읽고 이해하지 못한 것 같습니다.

다음 섹션을 고려하세요.

# Allow ping
#  note that blocking other types of icmp packets is considered a bad idea by some
#  remove -m icmp --icmp-type 8 from this line to allow all kinds of icmp:
#  https://security.stackexchange.com/questions/22711
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

모든 ICMP를 차단하는 것이 "나쁜 생각"인 한 가지 이유는 경로 MTU 검색이 작동하는 데 필요한 조각화 필요 응답과 같은 항목도 차단하고 있기 때문입니다. 그래도 작동하지 않으면 웹 페이지가 중단되고 다운로드가 중단되는 등의 문제가 발생합니다.

문제를 해결하려면 댓글에서 말하는 내용을 정확하게 삭제해야 합니다.


더 나은 방법은 이 방화벽을 완전히 덤프하고 CentOS 7에 포함된 시스템으로 돌아가는 것입니다. firewalld이는 부주의한 사람들을 위해 이러한 모든 트랩 없이 적절한 방화벽을 구성합니다.

관련 정보