1 Reply Latest reply on May 8, 2018 5:25 PM by Jason Glass

    JBoss EAP 7/Wildfly 10 - undertow reverse proxy isnt working

    Jason Glass Newbie

      Hi All!

       

      I've gone through quite a few forum posts on this and I see Tomaz has great answers and suggestions, but no matter what I try - I am unable to get the reverse-proxy functionality working, I've tried both this example:

      http://jeenotepad.blogspot.com/2017/09/reverse-proxy-in-wildfly.html as well as doing it this way

                     <host name="default-host" alias="localhost">
                          <location name="/" handler="welcome-content"/>
                          <filter-ref name="reverse-proxy"/>
                      </host>
      

      .

      .

      .

                <filters>
                      <response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
                      <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
                      <expression-filter name="reverse-proxy" expression="path-prefix('/L4BSSServlet') -> reverse-proxy({'https://10.140.100.100:10201/L4BSSServlet'})"/>
                  </filters>
      

       

      And I always just get "503 - Service Unavailable".

       

      I added debug as Tomaz said of:

                  <logger category="org.wildfly.extension.undertow">
                      <level name="TRACE"/>
                  </logger>
                  <logger category="org.xnio.nio">
                      <level name="TRACE"/>
                  </logger>
                  <logger category="io.undertow">
                      <level name="TRACE"/>
                  </logger>
      

       

      But all that really returned is:

      2018-05-04 12:38:57,753 TRACE [org.xnio.nio.selector] (default Accept) Selected on sun.nio.ch.EPollSelectorImpl@3f71b79
      2018-05-04 12:38:59,730 TRACE [org.xnio.nio.selector] (default Accept) Selected key sun.nio.ch.SelectionKeyImpl@9ab15a for sun.nio.ch.ServerSocketChannelImpl[/10.140.99.99:8443]
      2018-05-04 12:38:59,731 TRACE [org.xnio.nio.selector] (default Accept) Beginning select on sun.nio.ch.EPollSelectorImpl@3f71b79
      2018-05-04 12:38:59,731 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:38:59,731 TRACE [org.xnio.nio] (default I/O-4) Running task org.xnio.nio.QueuedNioTcpServer$1@7a018c21
      2018-05-04 12:38:59,733 TRACE [io.undertow.request] (default I/O-4) Opened connection with /10.140.250.54:31417
      2018-05-04 12:38:59,749 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:38:59,820 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:38:59,820 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$5$1@408452f3
      2018-05-04 12:38:59,820 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$2@2ef83cc4
      2018-05-04 12:38:59,821 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:39:00,283 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:39:00,283 TRACE [org.xnio.nio.selector] (default I/O-4) Selected key sun.nio.ch.SelectionKeyImpl@336ced77 for java.nio.channels.SocketChannel[connected local=/10.140.99.99:8443 remote=/10.140.250.54:31417]
      2018-05-04 12:39:00,283 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:39:00,299 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:39:00,299 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$5$1@7a946855
      2018-05-04 12:39:00,303 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$1@625e99ae
      2018-05-04 12:39:00,303 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$2@2ef83cc4
      2018-05-04 12:39:00,303 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:39:01,283 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:39:01,283 TRACE [org.xnio.nio.selector] (default I/O-4) Selected key sun.nio.ch.SelectionKeyImpl@336ced77 for java.nio.channels.SocketChannel[connected local=/10.140.99.99:8443 remote=/10.140.250.54:31417]
      2018-05-04 12:39:01,283 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$1@625e99ae
      2018-05-04 12:39:01,312 DEBUG [org.wildfly.extension.undertow] (default I/O-4) Creating http handler path-prefix('/L4BSSServlet') -> reverse-proxy({'https://10.140.100.100:10201/L4BSSServlet'}) from module null
      2018-05-04 12:39:01,332 TRACE [io.undertow.server.HttpServerExchange] (default I/O-4) Starting to write response for HttpServerExchange{ POST /L4BSSServlet request {Accept=[*/*], Content-Type=[application/x-www-form-urlencoded], Content-Length=[27], User-Agent=[curl/7.52.1], Host=[10.140.99.99:8443]} response {Connection=[keep-alive], X-Powered-By=[Undertow/1], Server=[JBoss-EAP/7], Content-Length=[84], Content-Type=[text/html], Date=[Fri, 04 May 2018 19:39:01 GMT]}}
      2018-05-04 12:39:01,336 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$1@625e99ae
      2018-05-04 12:39:01,337 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.protocols.ssl.SslConduit$1@625e99ae
      2018-05-04 12:39:01,337 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:39:01,338 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:39:01,338 TRACE [org.xnio.nio.selector] (default I/O-4) Selected key sun.nio.ch.SelectionKeyImpl@336ced77 for java.nio.channels.SocketChannel[connected local=/10.140.99.99:8443 remote=/10.140.250.54:31417]
      2018-05-04 12:39:01,338 TRACE [org.xnio.nio] (default I/O-4) Cancelling key sun.nio.ch.SelectionKeyImpl@336ced77 of java.nio.channels.SocketChannel[connected ishut local=/10.140.99.99:8443 remote=/10.140.250.54:31417] (same thread)
      2018-05-04 12:39:01,339 TRACE [org.xnio.nio.selector] (default Accept) Selected on sun.nio.ch.EPollSelectorImpl@3f71b79
      2018-05-04 12:39:01,339 TRACE [org.xnio.nio] (default Accept) Running task org.xnio.nio.QueuedNioTcpServer$2@28f1d334
      2018-05-04 12:39:01,339 TRACE [org.xnio.nio.selector] (default Accept) Beginning select on sun.nio.ch.EPollSelectorImpl@3f71b79
      2018-05-04 12:39:01,339 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2 (with timeout)
      2018-05-04 12:39:02,001 TRACE [org.xnio.nio.selector] (default I/O-4) Selected on sun.nio.ch.EPollSelectorImpl@3dab04b2
      2018-05-04 12:39:02,002 TRACE [org.xnio.nio] (default I/O-4) Running task io.undertow.util.DateUtils$2@10f52461
      2018-05-04 12:39:02,002 TRACE [org.xnio.nio.selector] (default I/O-4) Beginning select on sun.nio.ch.EPollSelectorImpl@3dab04b2

       

      I get the error both in browser and with curl

      curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --insecure -d "param1=value1&param2=value2" https://10.140.99.99:8443/L4BSSServlet
      <html><head><title>Error</title></head><body>503 - Service Unavailable</body></html>
      

       

      Any help would be appreciated!

       

      Thanks you in advance!

       

      Jay