gpt4 book ai didi

apache - 反向代理和 getServerPort() 背后的 WebSphere Portal

转载 作者:行者123 更新时间:2023-12-04 18:21:13 24 4
gpt4 key购买 nike

我在访问部署在反向代理后面(使用 Apache)的 WebSphere Portal 时遇到问题。问题在于,在检查浏览器发出的 HTTP 请求时,有些请求是针对代理的,而有些则直接针对 WebSphere Portal。

我的 Apache 配置:

ProxyPassReverseCookieDomain backend-server proxy-server

ProxyPass / http://backend-server:10039/
ProxyPassReverse / http://backend-server:10039/

问题是,一些生成的资源包含针对 backend-server:10039 的绝对 URI ......

我还应该配置什么才能在反向代理后面正确访问 WebSphere Portal?

最佳答案

因为我可以回答自己的问题,所以问题出在:

在服务器端,WebSphere Portal 中的 portlet 和 JSP 使用 request.getServerHost()request.getServerPort() .为了使这些方法在反向代理(发送 Host: header )之后工作。我不得不补充:

ProxyPreserveHost On

到 apache 配置和:
com.ibm.ws.webcontainer.extractHostHeaderPort = true
trusthostheaderport = true

IBM 控制台中 Web 容器的附加属性: WebSphere application servers -> WebSphere_Portal -> Web Container Settings -> Web Container -> Custom properties .

描述了这些属性 here .

关于apache - 反向代理和 getServerPort() 背后的 WebSphere Portal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10635110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com