如何在 IBM HTTP Proxy for Liberty Server 中附加上下文根

How to append context root in IBM HTTP Proxy for Liberty Server

我有一个 Java EAR 应用程序部署到几个 liberty 16.x 应用程序服务器,并且在它前面有一个 IBM HTTP 代理服务器 (Apache) 运行 作为负载均衡器和 HTTPS 代理。我想让我们的 Intranet 用户简单地输入一个容易记住的 URL,比如 https://product-aa and then be redirected to https://server-aa:8443/EarApplication,而不需要让他们在 URL.

中手动添加上下文根

我正在尝试找出实现此目标的最佳方法。

首先,在 DNS 中将 product-aa 注册为 server-aa 的 CNAME

然后追加到 httpd.conf:

NameVirtualHost *:80
<virtualhost *:80>
  ServerName server-aa
</virtualhost>
<virtualhost *:80>
  ServerName product-aa
  RedirectMatch ^/$ /EarApplication
  # ... or http://server-aa/EarApplication
</virtualhost>