FavoriteLoading
0

apache反向代理tomcat

最近,为了解决前端网页跨域的问题,我们采用了apache反向代理tomcat的方案。apache反向代理主要是利用proxy_mod模块。以下贴出部分配置文件
我是在apache的虚拟主机里配置的

# ServerAdmin prograsliu@gmail.com
DocumentRoot "/var/www/html"
# ServerName xxx.xxx.com
#ServerAlias test.com
SSLProxyEngine on
# SSLCertificateFile /etc/pki/tls/certs/server.crt
# SSLCertificateKeyFile /etc/pki/tls/private/server.key
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
# Alias /sublook "D:/www/test/look/sublook/"

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

ProxyPass /bannerSys http://xxx.xxx/a.do
ProxyPass /userSys http://xxx.xxx/b.html

如果要反向代理https,需要开启SSLProxyEngine on。如果是apache2.4还需要开启以下三个参数
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off