我如何告知 Websphere 7 有关前端负载均衡器的信息,以便正确处理重定向?

我如何告知 Websphere 7 有关前端负载均衡器的信息,以便正确处理重定向?

WebLogic 11G我可以使用控制台来设置前端主机前端端口在服务器或集群上,以便正确处理重定向并最终解析为前端负载均衡器而不是本地主机。

WebLogic 上与此相关的 MBean 例如:

MBean Name  com.bea:Name=AdminServer,Type=WebServer,Server=AdminServer
Attribute Name  FrontendHost
Description The name of the host to which all redirected URLs will be sent. If specified, WebLogic Server will use this value rather than the one in the HOST header.
Sets the HTTP frontendHost Provides a method to ensure that the webapp will always have the correct HOST information, even when the request is coming through a firewall or a proxy. If this parameter is configured, the HOST header will be ignored and the information in this parameter will be used in its place.
Type    java.lang.String
Readable / Writable RW

如何实现同样的目标Websphere 7

跟进信息:

所以我实际上有 2 个用例。

一个情况是,我在主机 A 上的 WebSphere 端口 9002 上运行一个 Web 应用程序,在主机 B 上的端口 80 上运行一个 LB,当我通过主机 B 上的 LB 访问该应用程序的主页时http://hostb/应用程序该应用程序将我的浏览器重定向到http://hostb:9002/应用程序并且出现 404

我认为这是 WebSphere 的错误,但我猜也可能是应用程序的错误?

第二个问题是,有问题的 Web 应用程序需要发送包含 URl 的电子邮件,客户可以单击该 URl 以返回 Web 应用程序 - 显然这需要通过 LB 进行。在 WebLogic 上,应用程序使用 MBean 来派生 LB url,我希望在 WebSphere 上使用类似的机制。

答案1

WebSphere 使用私有标头将前端主机标头传回 AppServer - 只需启动 Web 服务器 + WAS 插件,将插件日志记录级别设置为 TRACE,然后查看各个 $WSxx 标头中传递的内容。

相关内容