2

我们使用 WildFly 10 作为我们的应用服务器并通过 Docker 部署(在 WF 中部署是普通的热部署)。我们没有使用 WildFly 的集群机制,而只是在前面安装了负载均衡器(HAProxy)。

问题是WF 在EAR 部署仍在进行时打开了它的HTTP 端口。这(当然?)会导致我们不想在 LB 中专门处理的 HTTP 404 错误。这可能会导致假阴性...

有没有办法只在 EAR 成功启动后才允许 HTTP 连接?

或者,是否可以用“503 服务不可用”替换“404 因为这里没有部署任何内容”-错误?这会更好地表达问题,并且很容易在外部处理......

4

1 回答 1

4

You can set default-response-code for host you are running this on.

something along the lines:

<host name="default-host" alias="localhost" default-response-code="503">

or in cli:

/subsystem=undertow/server=default-server/host=default-host:write-attribute(name=default-response-code, value=503)

and similarly for any other host you might have.

于 2016-02-22T12:24:15.283 回答