WD1X.COM - 问答一下,轻松解决,电脑应用解决专家
主板显卡CPU内存显示器
硬盘维修显卡维修显示器维修
注册表系统命令DOS命令Win8
存储光存储鼠标键盘
内存维修打印机维修
WinXPWin7Win11Linux
硬件综合机箱电源散热器手机数码
主板维修CPU维修键盘鼠标维修
Word教程Excel教程PowerPointWPS
网络工具系统工具图像工具
数据库javascript服务器
PHP教程CSS教程XML教程

Apache服务器中设置端口映射和反向代理的方法

更新时间:2014-04-23 00:24 作者:佚名点击:

httpd.conf文件 ###new add for webui.cong###
Include "E:/local/Wamp/bin/apache/Apache2.2.17/conf/webui_port.conf"
Include "E:/local/Wamp/bin/apache/Apache2.2.17/conf/webui_proxy.conf"
webui_port.conf文件

#proxy本地端口映射

DocumentRoot "E:/www/yingshe/"
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from all DirectoryIndex index.php
</VirtualHost>
ProxyPass /yingshe http://192.168.10.12:8080/
ProxyPassReverse /yingshe http://192.168.10.12:8080/
<proxy http://192.168.10.12:8080/>
AllowOverride None
Order Deny,Allow
Allow from all
</proxy>

webui_proxy.conf文件
#proxy远程反响代理

Listen 8002
<VirtualHost *:8002>
    SSLProxyEngine on
    ProxyRequests on
    ProxyPass /      https://192.168.10.201/
    ProxyPassReverse /   https://192.168.10.201/
    <proxy   https://192.168.10.201/>
      AllowOverride None
      Order Deny,Allow
      Allow from all
    </proxy>
</VirtualHost>

总结
#Apache mod_proxy做反向代理
##要做更多支持请开启以下相应module
##proxy_module
##反向代理模块
##proxy_http_module
##反向代理http协议模块
##Rewrite_module
##地址重写
##ssl_module
##ssl协议模块
########################################################
# 通过https请求apache,apache也通过https访问系统
########################################################

Listen 443
<VirtualHost *:443>
  ProxyRequests On
  # 声明ssl代理引擎
  SSLProxyEngine on
  # 这里声明代理的URL转换处理
  # 注意需要使用域名,否则证书、用户页面的URL会有问题
  ProxyPass / https://www.×××.com/
  ProxyPassReverse / https://www.×××.com/
  #此处项目名称 /https://www.×××.com/ 代理为 / 跟目录访问,session会丢失,需要配置如下信息 
  ProxyPassReverseCookiePath /https://www.×××.com /
</VirtualHost>
#############################################################
# 通过http请求apache,apache也通过http访问代理站点
#############################################################
Listen 80
<VirtualHost *:80>
  ProxyRequests On
  ProxyPass / http://www.×××.com/
  ProxyPassReverse / http://www.×××.com/
  ProxyPassReverseCookiePath /https://www.×××.com /
  <proxy   https://www.×××.com>
      AllowOverride None
      Order Deny,Allow
      Allow from all
  </proxy>
</VirtualHost>
########################################################
# 通过http请求apache,apache通过https访问系统
########################################################
Listen 8002
<VirtualHost *:8002>
  ProxyRequests On
  # 声明ssl代理引擎
  SSLProxyEngine on
  # 这里声明代理的URL转换处理
  # 注意需要使用域名,否则证书、用户页面的URL会有问题
  ProxyPass / https://www.×××.com/
  ProxyPassReverse / https://www.×××.com/
  #此处项目名称 /https://www.×××.com/ 代理为 / 跟目录访问,session会丢失,需要配置如下信息 
  ProxyPassReverseCookiePath /https://www.×××.com /
  <proxy   https://www.×××.com>
      AllowOverride None
      Order Deny,Allow
      Allow from all
        </proxy>
</VirtualHost>

顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------
你可能感兴趣的内容