Mobile app version of vmapp.org
Login or Join
Welton855

: Configure JBoss to handle the home page URL instead of requiring users to type a long URL Question: Is there a way in JBOSS to have different URLs provided by the users resolve to other URLs;

@Welton855

Posted in: #CleanUrls #Java #Url #UrlRewriting

Question:

Is there a way in JBOSS to have different URLs provided by the users resolve to other URLs; i.e.
OurAppUat/ => OurAppUat/web/app?environment=UAT http://OurAppSIT/ => OurAppSIT/web/app?environment=SIT

Background:

Skip this bit unless you're thinking "what problem are you trying to solve?".

We have an web app developed by a third party which is hosted on JBoss.
This app is our company's operations system; available internally only.
We have some customisations, and as such have SIT, UAT and Production Replica environments to allow us to test customisations and reproduce production issues.

For various reasons, we often need to switch around the servers hosting environments (e.g. so we can prepare a refreshed copy of UAT on the SIT server whilst the current UAT environment's in use, then switch the users/testers to the refreshed instance before moving and refreshing SIT onto the former UAT server).

It is possible for multiple environments to be hosted independently on the same server; but we try to avoid this when possible to ensure the environments aren't affected by testing being done in another environment, and also to allow us to restart servers/services as required without concerning ourselves with other instances which may be sharing the same host.

What we're trying to do

Users currently connect to the app on URLs such as:

myServer01/web/app?environment=UAT http://myServer02/web/app?environment=SIT


We'd like to simplify this to:

OurAppUat/ http://OurAppSIT/


Using DNS we can get as far as:

OurAppUat/web/app?environment=UAT http://OurAppSIT/web/app?environment=SIT


The advantage is this allows us to switch servers around behind the scenes (and perhaps add in load balancing down the line) without affecting the URLs used by our users. That's achieved by repointing the DNS name to the correct resource's IP.

The further advantage of removing the rest of the URL is the URLs become human readable; with so users can look at the URL and tell what environment they're in without having to understand which part of the URL to read (though it looks obvious, most users seem to panic at the site of a long URL rather than just scanning it for the environment name).

Similar Questions

serverfault.com/questions/517297/url-redirect-using-windows-dns/517300#517300

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Welton855

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

JBoss does support rewrite rules which can be used to support this. From the documentation, you would first have to add this configuration in the server.xml file:

<Valve className="org.jboss.web.rewrite.RewriteValve" />


Then you would have to create a rewrite.properties file with something like this:

RewriteRule ^/$ /web/app?environment=UAT [L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme