squid代理配置

  1. 安装Squid
    yum -y update
    yum -y install epel-release
    yum -y update
    yum clean all

    yum -y install squid
    systemctl start squid
    systemctl enable squid   # 开机自启动
    systemctl status squid   # 查看服务状态
    squid -v   # 查看版本

2.允许不同用户使用不同的出口IP

    # 安装生成用户密码验证文件的软件
    yum -y install httpd-tools
    touch /etc/squid/passwd && chown squid /etc/squid/passwd
    htpasswd /etc/squid/passwd pxuser
    
    # 配置用户认证信息
        # 选择的认证方式为basic,认证程序路径和密码文件路径。
        auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd 
        # 认证程序的进程数
        auth_param basic children 10
        # 认证有效时间
        auth_param basic credentialsttl 4 hours
        # 不区分大小写
        auth_param basic casesensitive off


        # 配置不同用户的出口IP
        acl acl_user1 proxy_auth -i user1
        http_access allow acl_user1
        tcp_outgoing_address 10.10.12.1 acl_user1

        acl acl_user2 proxy_auth -i user2
        http_access allow acl_user2
        tcp_outgoing_address 10.10.12.1 acl_user2

3.设置代理高匿

    via off
    forwarded_for off  /  forwarded_for delete
    follow_x_forwarded_for deny all


    request_header_access From deny all
    request_header_access Server deny all
    request_header_access WWW-Authenticate deny all
    request_header_access Link deny all
    request_header_access Cache-Control deny all
    request_header_access Proxy-Connection deny all
    request_header_access X-Cache deny all
    request_header_access X-Cache-Lookup deny all
    request_header_access Via deny all
    request_header_access X-Forwarded-For deny all
    request_header_access Pragma deny all
    request_header_access Keep-Alive deny all
  1. 禁用缓存
    cache deny all
    With Squid-2.7, Squid-3.1 and later you can also remove all 'cache_dir' options from your squid.conf to avoid having a cache directory.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,933评论 18 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 46,958评论 6 342
  • nginx在工作中已经有好几个环境在使用了,每次都是重新去网上扒博客,各种编译配置,今天自己也整理一份安装文档和n...
    AndyChin阅读 2,327评论 0 4
  • The quick shall inherit the earth. Fast is better than sl...
    poofee阅读 745评论 0 1
  • Authorizing Payments 支付授权处理是支付授权视图控制器和它的代理之间的协力合作的结果。支付授权...
    NEWWORLD阅读 1,444评论 2 0