来自互联网的入站请求的 Squid 代理配置

来自互联网的入站请求的 Squid 代理配置

我喜欢配置一个 squid 代理服务器,它允许来自 Internet 的用户匿名连接,然后能够通过代理访问其他网站。有人有我可以使用的配置示例吗?环境是 Debian Linux 上的 squid 3。

答案1

这来自 FreeBSD 环境,但非常相似。它设置为监听 10.0.0.4:8083。但是,我强烈建议不要使用开放代理。除非您非常非常小心并且有某种形式的访问控制,否则您将陷入麻烦。人们会通过您的服务器发起攻击、通过它们进行欺诈等等。

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
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 allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny to_localhost

http_access allow all
deny_info ERR_ACCESS_DENIED all
deny_info ERR_ACCESS_DENIED passwords
icp_access deny all
http_port 10.0.0.4:8083
hierarchy_stoplist cgi-bin ?
access_log /usr/local/squid/logs/access.log squid
useragent_log /usr/local/squid/logs/useragent.log squid
debug_options ALL,7
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
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

相关内容