技術を楽しもう!

IT(ネットワーク)業界を中心に、仕事や趣味等、色々な技術を記録します。

squidでBASIC認証がかからない場合

https://www.pakutaso.com/shared/img/thumb/cryptocurrency1442_TP_V.jpg

HTTP Proxyで認証がかかる環境が必要で検証していたところ、 squidBASIC認証の設定を追加しても、認証されないことがありました。

「/etc/squid/squid.conf」を参考にしたページの設定内容と見比べても問題なく、 「systemctl restart squid」も実施済みでした。

既存の設定が悪影響をしている可能性を考え、 squid.confのバックアップをとり、中身を全て削除して下記だけにした後、 「systemctl restart squid」を実施することで認証されるようになりました。

[/etc/squid/squid.conf]

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
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/.htpasswd
auth_param basic children 5
auth_param basic realm Squid Basic Authentication
auth_param basic credentialsttl 5 hours
acl password proxy_auth REQUIRED
http_access allow password
no_cache deny all
http_port 8080
cache_store_log none
coredump_dir /var/spool/squid
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
ipcache_size 5120