設定 http://reverse proxy/a/ 轉向 http://192.168.1.1:8080 (tomcat)
設定 https://reverse proxy/aa/ 轉向 https://192.168.1.2 (tomcat)
1. 安裝 apache modules mod_proxy_html
2.修改 /etc/httpd/conf.d/proxy_html.conf 內容
ProxyRequests Off ProxyPass /a/ http://192.168.1.1:8080/ <Location /a/> ProxyPassReverse / ProxyHTMLEnable On ProxyHTMLURLMap http://192.168.1.1:8080/ /a/ ProxyHTMLURLMap / /a/ </Location > ProxyPass /aa/ https://192.168.1.2/ <Location /aa/> ProxyPassReverse / ProxyHTMLEnable On ProxyHTMLURLMap https://192.168.1.2/ /aa/ ProxyHTMLURLMap / /aa/ </Location>
3修改 server.xml log 相關設定,加入真正瀏覽 ip
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="access_log" suffix=".log" pattern="%h %v %u %t %r %s %b %{X-Forwarded-For}i" resolveHosts="false"/>
mod_proxy_html rpm 下載
http://pkgs.org/centos-6/epel-x86_64/mod_proxy_html-3.1.2-6.el6.x86_64.rpm.html
沒有留言:
張貼留言