本文共 1876 字,大约阅读时间需要 6 分钟。
Allow 127.0.0.1
以启用本地访问。ConnectPort 80
以支持普通HTTP端口。以下是配置文件中的核心设置:
# 用户和组(建议根据需求设置): # User your_user # Group your_group # �istr信Port设置(默认8888): # Port 8888 # 绑定单一IP(默认绑定所有IP): # Listen 192.168.0.1 # 出站规则: # Bind 192.168.0.1 # 启用BoundSame: # BindSame yes # 连接超时设置(默认600秒): # Timeout 600 # 定义错误页面路径(默认情况下查找路径): # ErrorFile 404 "/usr/share/tinyproxy/404.html" # 其他错误类型自行添加。 # 设置默认错误页面: # DefaultErrorFile "/usr/share/tinyproxy/default.html" # 定义统计域名: # StatHost "tinyproxy.stats" # 指定自定义统计页面: # StatFile "/usr/share/tinyproxy/stats.html" # 日志设置(推荐使用syslog): # Syslog On # Logfile "/var/log/tinyproxy/tinyproxy.log" # 日志级别设置(默认为Info): # LogLevel Info # 进程文件: # PidFile "/run/tinyproxy/tinyproxy.pid" # 添加X-Tinyproxy头: # XTinyproxy Yes # 启用上游代理(如需要): # Upstream firewall:8080 ".example.com" # 最大客户数量: # MaxClients 100 # 初次启动服务器数量: # StartServers 10 # 每个连接的最大数量: # MaxRequestsPerChild 0 # 定义允许访问的IP段: # 允许访问本地IP: # Allow 127.0.0.1 # 允许访问私有网络: # Allow 192.168.0.0/16 # 允许访问内网: # Allow 172.16.0.0/12 # 允许访问公司网络: # Allow 10.0.0.0/8
ConnectPort 443
以支持HTTPS。MaxSpareServers
和StartServers
。MaxRequestsPerChild 10000
。通过以上步骤,可以轻松配置并使用tinyproxy作为正向代理服务器。
转载地址:http://hckaz.baihongyu.com/