0

我在 AWS 的 Openshift Origin 3 上使用弹性 IP 运行 Wildfly 10。

我在 Openshift 中设置了一个路由来映射 / 到 wildfly 服务。这工作正常。如果我去http: //my.ip.address我会得到 WildFly 欢迎页面。

但是如果我映射一个不同的路径,比如 /wf01,它就不起作用了。我收到 404 Not Found 错误。

我的猜测是路由器正在将 /wf01 传递给服务?如果是这样,我可以阻止它这样做吗?否则如何将http: //my.ip.address/wf01 映射到我的 Wildfly 服务?

我还希望可以从外部访问 Wildfly 控制台(这是我自己使用的演示服务器)。我在部署配置中添加了“-bmanagement”、“0.0.0.0”,但查看 wildfly 日志它仍然绑定到 127.0.0.1:

02:55:41,483 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: 
Admin console listening on http://127.0.0.1:9990
4

2 回答 2

1

今天的路由器在传递之前无法将传入的 HTTP 路径重新映射/重写为另一个路径值。一种解决方法是在根处安装另一个路由+服务来处理根并重定向/转发。

于 2016-04-17T16:43:10.037 回答
1

您还可以使用端口转发:

oc port-forward -h
Forward 1 or more local ports to a pod

Usage:
  oc port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N] [options]

Examples:
  # Listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
  $ oc port-forward -p mypod 5000 6000

  # Listens on port 8888 locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod 8888:5000

  # Listens on a random port locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod :5000

  # Listens on a random port locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod 0:5000
于 2016-05-20T08:24:48.660 回答