How to configure Wildfly load balancing with redirect

拜拜、爱过 提交于 2019-12-11 12:04:11

问题


I am working with wildfly undertow load balancer , and I added following configuration in standalone-load-balancer.xml but my request is not getting redirected? I added reverse proxy handler and host to the Undertow subsystem as :

<handlers>
       <reverse-proxy name="keycloak-handler">
       <host name="keycloak-host" outbound-socket-binding="remote-host" path="/auth"/>
      </reverse-proxy>
 </handlers>

And then I defined outbound socket bindings for remote hosts as :

 <outbound-socket-binding name="remote-host">
            <remote-destination host="192.168.1.5" port="8443"/>
 </outbound-socket-binding>

And then added the reverse proxy to a location as :

<host name="default-host">
    <location name="/auth" handler="keycloak-handler"/>
     <filter-ref name="load-balancer"/>
</host>

回答1:


The mistake I was doing here is , my load balancer was with ssl enabled and I was communicating with keycloak via 8443 which expecting load balancer and keycloak both with same certificates. So to get rid off this , I have connected to keycloak via 8080 port and I have enabled ssl only with load balancer . So after changing below code it worked for me:

<outbound-socket-binding name="remote-host">
            <remote-destination host="192.168.1.5" port="8080"/>
 </outbound-socket-binding>


来源:https://stackoverflow.com/questions/54289198/how-to-configure-wildfly-load-balancing-with-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!