2.1 正向代理

注意:配置正向代理需要做:

  1. yum -y install gcc gcc-c++ autoconf automake libtool make cmake
  2. yum -y install zlib zlib-devel openssl openssl-devel gd-devel
  3. yum -y install patch pcre pcre-devel git
  4. # 安装nginx
  5. cd /opt/nginx-1.8.0/
  6. # 下载ngx_http_proxy_connect_module模块,打补丁
  7. git clone https://github.com/chobits/ngx_http_proxy_connect_module.git
  8. patch -p1 < ./ngx_http_proxy_connect_module/patch/proxy_connect_1014.patch
  9. # 编译安装
  10. ./configure --prefix=/usr/local/nginx \
  11. --user=nginx --group=nginx \
  12. --with-debug --with-http_ssl_module \
  13. --with-http_realip_module \
  14. --with-http_image_filter_module \
  15. --with-http_gunzip_module \
  16. --with-http_gzip_static_module \
  17. --with-http_stub_status_module \
  18. --http-log-path=/var/log/nginx/access.log \
  19. --error-log-path=/var/log/nginx/error.log \
  20. --add-module=./ngx_http_proxy_connect_module