跳至内容
sdvcrx's wiki
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
Export to Markdown
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
linux:squid
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== Squid ====== [[wp>Squid_(software)|Squid]] is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. ===== Installation ===== <code bash> yum install squid systemctl start squid </code> ===== HTTP basic authenication ===== <code bash> touch /etc/squid/passwd && chown squid /etc/squid/passwd htpasswd /etc/squid/passwd [username] </code> Edit ''/etc/squid/squid.conf'': <code conf /etc/squid/squid.conf> auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param basic realm Squid Basic Authentication auth_param basic credentialsttl 2 hours acl auth_users proxy_auth REQUIRED http_access allow auth_users </code> And reload squid: systemctl reload squid ===== Specify domain throught proxy ===== Squid 实现代理分流 <code> acl proxyrule dstdomain [example1.org] [example2.org] cache_peer [proxy:ip] parent [proxy:port] 0 round-robin proxy-only no-query name=px cache_peer_access px allow proxyrule never_direct allow proxyrule </code> ''never_direct allow proxyrule'' 需要打个重点标记,加了后就 **能解决某些请求不经过 cache_peer 的问题** 。 ===== Reference ===== * [[https://hostpresto.com/community/tutorials/how-to-install-and-configure-squid-proxy-on-centos-7/|How to Install and Configure Squid Proxy on CentOS 7]] * [[https://wiki.squid-cache.org/SquidFaq/SquidAcl|Access Controls in Squid]]
linux/squid.txt
· 最后更改: 2023/12/03 10:24 由
127.0.0.1
页面工具
显示页面
过去修订
反向链接
Export to Markdown
回到顶部