Apache中的mod_proxy模块具有代理的功能主要用于进行URL转发,此功能实现了通Jboss、Tomcat等应用服务器的整合,甚至还可以很方便的实现WEB集群的功能。
main-ssl.conf&httpd.conf
代理指令:
1. ProxyPass
语法:ProxyPass [path] !|url
例如:ProxyPass /test_portal https://192.168.0.1/test_portal
2. ProxyPassReverse 通常与ProxyPass配置成一样的
语法:ProxyPassReverse [path] url
例如:ProxyPass /test_portal https://192.168.0.1/test_portal
3. ProxyPassMatch
语法:ProxyPassMatch [regex] !|url
例如:
ProxyPassMatch ^/images ! 这个示例表示对/images的请求,都不会被转发。
ProxyPassMatch ^(/.*.gif)1 这个示例表示对所有gif图片的请求,都被会转到后端
架构图如下:

相关文件:main-ssl.conf&httpd.conf
脚本:
ProxyRequests Off
ProxyPreserveHost On
SSLProxyEngine On
SSLProxyCheckPeerCN off
ProxyPass /test_portal https://192.168.0.1/test_portal
ProxyPassReverse /test_portal https://192.168.0.1/test_portal
SSLEngine on
本文介绍了Apache中的mod_proxy模块如何实现URL转发,并整合Jboss、Tomcat等应用服务器,同时展示了如何通过配置实现WEB集群。文章详细解释了关键指令如ProxyPass、ProxyPassReverse和ProxyPassMatch的使用方法。

2515

被折叠的 条评论
为什么被折叠?



