4 Replies Latest reply on Mar 5, 2014 8:13 AM by rhusar

    Reverse Proxy Configuration

    hwellmann.de

      I would like to try out the new reverse proxy functionality in WIldFly 8.0.0.Final. This is mentioned in the release notes, but I can't find any documentation. Does anybody have an example config?

       

      Thanks,

      Harald

        • 1. Re: Reverse Proxy Configuration
          ctomc

          Hey,

           

          it is simple, just add reverse-proxy handler under <handlers>

          example:

          <handlers>

                  <reverse-proxy name="reverse-proxy" connections-per-thread="30">

                      <host name="ajp://localhost:8080" instance-id="myRoute"/>

                  </reverse-proxy>

              </handlers>

          then just reference your handler in host configuration.

           

           

          --

          tomaz

          1 of 1 people found this helpful
          • 2. Re: Reverse Proxy Configuration
            hwellmann.de

            Thanks, that got me going, but I had to add this to get rid of a 404:

             

                <location name="/" handler="reverse-proxy"/>

             

            Also, I got a 500 when trying

             

                <host name="http://www.jboss.org" instance-id="myRoute"/>

             

            I had to add the port number like this:

              

                <host name="http://www.jboss.org:80" instance-id="myRoute"/>

            • 3. Re: Reverse Proxy Configuration
              ctomc

              Harald Wellmann wrote:

               

              Also, I got a 500 when trying

               

                  <host name="http://www.jboss.org" instance-id="myRoute"/>

               

              Can you paste stack trace?

              • 4. Re: Re: Reverse Proxy Configuration
                rhusar

                Tomaz Cerar wrote:

                 

                Harald Wellmann wrote:

                 

                Also, I got a 500 when trying

                 

                    <host name="http://www.jboss.org" instance-id="myRoute"/>

                 

                Can you paste stack trace?

                Here it is:

                 

                14:09:01,101 ERROR [io.undertow.request] (default I/O-1) Blocking request failed HttpServerExchange{ GET /}: java.lang.IllegalArgumentException: port out of range:-1
                  at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143) [rt.jar:1.7.0_51]
                  at java.net.InetSocketAddress.<init>(InetSocketAddress.java:224) [rt.jar:1.7.0_51]
                  at io.undertow.client.http.HttpClientProvider.connect(HttpClientProvider.java:64)
                  at io.undertow.client.UndertowClient.connect(UndertowClient.java:89)
                  at io.undertow.server.handlers.proxy.ProxyConnectionPool.openConnection(ProxyConnectionPool.java:134)
                  at io.undertow.server.handlers.proxy.ProxyConnectionPool.connect(ProxyConnectionPool.java:278)
                  at io.undertow.server.handlers.proxy.LoadBalancingProxyClient.getConnection(LoadBalancingProxyClient.java:225)
                  at io.undertow.server.handlers.proxy.ProxyHandler$3.run(ProxyHandler.java:147)
                  at io.undertow.util.SameThreadExecutor.execute(SameThreadExecutor.java:17)
                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:180)
                  at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:153)
                  at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:69)
                  at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:38)
                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
                  at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
                  at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
                  at org.xnio.nio.NioTcpServerHandle.handleReady(NioTcpServerHandle.java:53) [xnio-nio-3.2.0.Final.jar:3.2.0.Final]
                  at org.xnio.nio.WorkerThread.run(WorkerThread.java:531) [xnio-nio-3.2.0.Final.jar:3.2.0.Final]
                

                 

                apart form that it seems to work fine. Should we default to 80/443?