我在访问部署在反向代理后面的Apache时遇到了问题(使用WebSphere )。问题是,在检查浏览器发出的HTTP请求时,有些请求是针对proxy的,有些是直接针对WebSphere Portal的。
我的Apache配置:
ProxyPassReverseCookieDomain backend-server proxy-server
ProxyPass / http://backend-server:10039/
ProxyPassReverse / http://backend-server:10039/问题是,一些生成的资源包含针对后端服务器的绝对URI:10039...
我还应该配置什么才能在反向代理后正确访问WebSphere门户?
发布于 2012-05-17 19:48:33
因为我可以回答自己的问题,所以问题是这样的:
在服务器端,WebSphere门户中的portlets和JSP使用request.getServerHost()和request.getServerPort()。要使这些方法在反向代理(发送Host:报头)后工作。我不得不补充一句:
ProxyPreserveHost On添加到apache配置和:
com.ibm.ws.webcontainer.extractHostHeaderPort = true
trusthostheaderport = trueIBM Console中Web Container的其他属性:WebSphere application servers -> WebSphere_Portal -> Web Container Settings -> Web Container -> Custom properties。
这些属性在here中有描述。
发布于 2015-01-15 17:01:01
几天前我遇到了同样的问题,最终选择了apache mod_substitute来更改这些urls,如下所示:
Substitute "s|http ://backend-server:10039/|/|i"
https://stackoverflow.com/questions/10635110
复制相似问题