-
-
2. Re: Reverse Proxy
paaviru Mar 4, 2014 11:12 AM (in response to ctomc)Thank you, but I am not quite sure where that configuration should go...
-
3. Re: Re: Reverse Proxy
rhusar Mar 5, 2014 8:02 AM (in response to paaviru)1 of 1 people found this helpfulOpen standalone.xml (or standalone-ha.xml) and look for the Undertow subsystem section.
The bold lines will add on default host on / location a reverse proxy handler for a domain example.com:
<subsystem xmlns="urn:jboss:domain:undertow:1.0">
<buffer-caches>
<buffer-cache name="default" buffer-size="1024" buffers-per-region="1024" max-regions="10"/>
</buffer-caches>
<server name="default-server">
<ajp-listener name="ajp" socket-binding="ajp"/>
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="reverse-proxy"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
<reverse-proxy name="reverse-proxy" connections-per-thread="30">
<host name="http://www.example.com:80" instance-id="myRoute"/>
</reverse-proxy>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="Wildfly 8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow 1"/>
</filters>
</subsystem>
-
4. Re: Reverse Proxy
paaviru Mar 5, 2014 11:50 AM (in response to rhusar)Thank you for the response, I am getting an error 500 when opening localhost:8080
-
5. Re: Reverse Proxy
rhusar Mar 6, 2014 4:35 AM (in response to paaviru)1 of 1 people found this helpfulPablo Aviles wrote:
Thank you for the response, I am getting an error 500 when opening localhost:8080
You need to specify the scheme. Correct value would be "http://localhost:8080". Otherwise you will see in the log:
10:32:36,877 ERROR [io.undertow.request] (default I/O-1) Blocking request failed HttpServerExchange{ GET /}: java.lang.IllegalArgumentException: UT001031: Unknown scheme in URI localhost:8080
-
6. Re: Reverse Proxy
valsaraj007 Apr 17, 2017 6:06 AM (in response to rhusar)Me too got same with http2.