0

Excuse me, I'm new to this. I have developed an application with maven, and when I run the application in my wildfly it opens the following path: "127.0.0.1:8080/myapp-1.0.0" and everything runs perfect, but I simply want that: x.x.x.x/ point to: x.x.x.x:8080/myapp-x.x.x

I do not know if it is a configuration in standalone.xml as it redirects or something more complicated.

  • Will this link help you? https://stackoverflow.com/questions/5709223/how-to-auto-direct-to-my-web-application-from-root-context-in-jboss – Kelvin Ho Mar 02 '21 at 05:21
  • You are using way to many `x` for different things. Do you want to bind your server on a different IP-address than localhost? – cfrick Mar 02 '21 at 05:41
  • You will need a reverse proxy in front of your application. Apache HTTP or Nginx for example – Simon Martinelli Mar 02 '21 at 10:46

1 Answers1

1

If you only have a single web application, the simplest way is to have jboss-web.xml file in your web application. Put a file like:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web version="10.0"
           xmlns="http://www.jboss.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd">

    <context-root>/</context-root>
</jboss-web>

in your WEB-INF directory. This will make your application run at the / context. Note that this isn't redirection - it's permanently there. Additionally, if you have many webapps running on your Wildfly server they will all need a unique context root.

stdunbar
  • 16,263
  • 11
  • 31
  • 53