博客
关于我
tinyproxy正向代理
阅读量:611 次
发布时间:2019-03-13

本文共 1876 字,大约阅读时间需要 6 分钟。

tinyproxy正向代理配置指南

安装tinyproxy
在Ubuntu系统中,可以使用以下命令安装tinyproxy: `sudo apt-get install tinyproxy`
配置tinyproxy
使用文本编辑器(如`nano`)打开配置文件: `sudo nano /etc/tinyproxy/tinyproxy.conf`

必要设置:

  • 指定监听端口:留用默认端口80,不需要修改。
  • 允许本地访问:注释或删除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
    刷新系统设置
    重启tinyproxy后,建议执行以下命令以确保网络正常: `sudo netsh winsock reset` `sudo netsh int ip reset`
    文件路径注意事项
    确保Following路径存在: - 404.html:`/usr/share/tinyproxy/404.html` - 400.html:`/usr/share/tinyproxy/400.html` - 503.html:`/usr/share/tinyproxy/503.html` - 403.html:`/usr/share/tinyproxy/403.html` - 408.html:`/usr/share/tinyproxy/408.html` - 默认页面:`/usr/share/tinyproxy/default.html` - 统计页面:`/usr/share/tinyproxy/stats.html`

    其他建议:

    • 如果使用ssl požadided,添加ConnectPort 443以支持HTTPS。
    • 根据实际需求调整MaxSpareServersStartServers
    • 为提高性能,可设置MaxRequestsPerChild 10000

    通过以上步骤,可以轻松配置并使用tinyproxy作为正向代理服务器。

    转载地址:http://hckaz.baihongyu.com/

    你可能感兴趣的文章
    NutzWk 5.1.5 发布,Java 微服务分布式开发框架
    查看>>
    NUUO网络视频录像机 css_parser.php 任意文件读取漏洞复现
    查看>>
    NVelocity标签使用详解
    查看>>
    Nvidia Cudatoolkit 与 Conda Cudatoolkit
    查看>>
    nvidia-htop 使用教程
    查看>>
    oauth2-shiro 添加 redis 实现版本
    查看>>
    OAuth2.0_JWT令牌-生成令牌和校验令牌_Spring Security OAuth2.0认证授权---springcloud工作笔记148
    查看>>
    OAuth2.0_JWT令牌介绍_Spring Security OAuth2.0认证授权---springcloud工作笔记147
    查看>>
    OAuth2.0_介绍_Spring Security OAuth2.0认证授权---springcloud工作笔记137
    查看>>
    OAuth2.0_完善环境配置_把资源微服务客户端信息_授权码存入到数据库_Spring Security OAuth2.0认证授权---springcloud工作笔记149
    查看>>
    OAuth2.0_授权服务配置_Spring Security OAuth2.0认证授权---springcloud工作笔记140
    查看>>
    OAuth2.0_授权服务配置_令牌服务和令牌端点配置_Spring Security OAuth2.0认证授权---springcloud工作笔记143
    查看>>
    OAuth2.0_授权服务配置_客户端详情配置_Spring Security OAuth2.0认证授权---springcloud工作笔记142
    查看>>
    OAuth2.0_授权服务配置_密码模式及其他模式_Spring Security OAuth2.0认证授权---springcloud工作笔记145
    查看>>
    OAuth2.0_授权服务配置_资源服务测试_Spring Security OAuth2.0认证授权---springcloud工作笔记146
    查看>>
    OAuth2.0_环境介绍_授权服务和资源服务_Spring Security OAuth2.0认证授权---springcloud工作笔记138
    查看>>
    OAuth2.0_环境搭建_Spring Security OAuth2.0认证授权---springcloud工作笔记139
    查看>>
    oauth2.0协议介绍,核心概念和角色,工作流程,概念和用途
    查看>>
    OAuth2授权码模式详细流程(一)——站在OAuth2设计者的角度来理解code
    查看>>
    oauth2登录认证之SpringSecurity源码分析
    查看>>