Turn the annex to a port in wildfly



  • In default, annexes in wildfly are decorated at the address. localhost:8080/apphow to deploy an annex to a single port without the name of the annex itself, for example, to be available at the address localhost:8282?



  • The whole Wildfly configuration is in domain. Example for standalone.xml and Wildfly10:

    Opening %JBOSS_HOME%/standalone/configuration/standalone.xmlTega socket-binding-group We'll add in addition. http and https Add. http2 and https2

    <!--Стандартные биндинги-->
    <socket-binding name="http" port="${jboss.http.port:8080}"/>
    <socket-binding name="https" port="${jboss.https.port:8443}"/>
    <!--Добавленные биндинги-->
    <socket-binding name="http2" port="${jboss.http.port:8089}"/>
    <socket-binding name="https2" port="${jboss.https.port:8449}"/>
    

    Next we're looking. urn:jboss:domain:undertow:3.0 and add a new server:

    <!--Сервер по умолчанию-->
    <server name="default-server">
      <http-listener name="default" socket-binding="http" redirect-socket="https"/>
      <host name="default-host" alias="localhost">
        <filter-ref name="server-header"/>
        <filter-ref name="x-powered-by-header"/>
      </host>
    </server>
    <!--Сервер, который мы добавили-->
    <server name="non-default-server">
      <http-listener name="oteher" socket-binding="http2" redirect-socket="https2"/>
      <host name="default-host" alias="localhost">
        <filter-ref name="server-header"/>
        <filter-ref name="x-powered-by-header"/>
      </host>
    </server>
    

    Notice that they removed from both servers:

    <location name="/" handler="welcome-content"/>
    

    That's what we need binda for our applications. "/"

    That's it. The configuration can be maintained Wildfly server reset

    Next, in the very annex in the catalogue. WEB-INF need to create a file jboss-web.xml with the following contents:

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
        <context-root>/</context-root>
        <server-instance>non-default-server</server-instance>
    </jboss-web>
    

    If server-instance Not to mention, the applications will be branded to the main server.

    I mean, with this arrangement, your server will listen to two ports. If the port and context-root simply need to be changed, the challenge is to edit socket-binding and add jboss-web.xml




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2