分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

centos7 下 apache nginx squid https正向代理

发布时间:2023-09-06 02:00责任编辑:沈小雨关键词:apachenginxhttp
  • apache

yum install httpd mod_ssl -yvim /etc/httpd/conf.d/ssl.confListen 443 https<VirtualHost *:443>
???ServerName example.com ???SSLEngine on ???SSLCertificateFile /cert/server.crt ???SSLCertificateKeyFile /cert/server.key ???ProxyRequests On ???ProxyVia On ???<Proxy *> ???????Order deny,allow ???????allow from all ???</Proxy></VirtualHost>systemctl restart httpd
  • nginx

nginx 默认并不支持代理https需要第三方模块支持

编译安装nginx

yum install gc gcc gcc-c++ pcre-devel zlib-devel openssl-devel patch wget -ywget http://nginx.org/download/nginx-1.9.2.tar.gzwget https://github.com/chobits/ngx_http_proxy_connect_module/archive/master.ziptar -xzvf nginx-1.9.2.tar.gz unzip master.zipcd nginx-1.9.2patch -p1 < ../ngx_http_proxy_connect_module-master/patch/proxy_connect.patch./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-stream --add-module=/root/ngx_http_proxy_connect_module-mastermake && make install

 nginx配置文件

vim /usr/local/nginx/conf/nginx.conf

worker_processes ?1;events { ???worker_connections ?1024;}http { ???include ??????mime.types; ???default_type ?application/octet-stream; ???sendfile ???????on; ???keepalive_timeout ?65; ???server { ???listen 443 ssl; ???resolver ??????????????????????8.8.8.8; ???ssl on; ???ssl_certificate /cert/server.crt; ???ssl_certificate_key /cert/server.key; ???ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ???server_name example.com; ???proxy_connect; ???proxy_connect_allow ???????????443 563; ???proxy_connect_connect_timeout ?10s; ???proxy_connect_read_timeout ????10s; ???proxy_connect_send_timeout ????10s; ???location / { ????????proxy_pass https://$host; ????????proxy_set_header Host $host; ??????????} ???????} ?}

/usr/local/nginx/sbin/nginx

  •  squid

yum install squid -yvim /etc/squid/squid.confhttps_port 8443 cert=/cert/server.crt key=/cert/server.keydns_nameservers 8.8.8.8http_access allow allsystemctl restart squid

centos7 下 apache nginx squid https正向代理

原文地址:https://www.cnblogs.com/37yan/p/9188292.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved