0

I have Wildfly 10 running on Openshift Origin 3 in AWS with an elastic ip.

I setup a Route in Openshift to map / to the wildfly service. This is working fine. If I go to http://my.ip.address I get the WildFly welcome page.

But if I map a different path, say /wf01, it doesn't work. I get a 404 Not Found error.

My guess is the router is passing along the /wf01 to the service? If that's the case, can I stop it from doing it? Otherwise how can I map http://my.ip.address/wf01 to my wildfly service?

I also want the wildfly console to be accessible from outside (this is a demo server for my own use). I added "-bmanagement","0.0.0.0" to the deploymentconfig but looking at the wildfly logs it is still binding to 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
Lionel Orellana
  • 490
  • 1
  • 6
  • 12

2 Answers2

1

A router today cannot remap/rewrite the incoming HTTP path to another path value before passing it along. A workaround is to mount another route+service at the root that handles the root and redirects / forwards.

Clayton
  • 3,281
  • 1
  • 18
  • 14
1

You can also use port-forward :

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
Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48