When upgrading from AppWorks Gateway 1.2.x to 16.x, you may want your users to access your configured services via the same URL as before. This article describes how to use URL rewriting to achieve this.
In AppWorks Gateway 16.x both the Gateway and the Administration Console are accessed via the root context of the Apache Tomcat installation.
This is a change from AppWorks Gateway 1.2.x, where users were taken to
https://[appworksurl]/, from where they could access the services that were configured there, for example, Tempo Box or Tempo Social.
When upgrading to 16.x, you may want to ensure that users continue to access any configured services with the URL they used prior to the upgrade.
To do this, you can use URL rewriting to perform a URL redirect to the
The following steps describe how to redirect your users from
http://host.opentext.com/content by downloading and configuring a Java Web filter for the Apache Tomcat installation.
Stop the Apache Tomcat service.
Go to the UrlRewriteFilter web site.
urlrewritefilter-4.0.3.jar link in Step 1 of the Install process. To review the documentation for the Web Filter, click Documentation at the top of the page, then click the link to the 4.0 User Manual.
Save the .jar file to
Add the following to the
<filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <async-supported>true</async-supported> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
UrlRewriteFiltermust be the first filter in the
urlrewrite.xml file in
<Tomcat_Home>/gateway/WEB-INF/, with the following contents:
<urlrewrite> <rule> <name>redirect from root</name> <condition name="host" operator="equal">host.opentext.com</condition> <from>^/$</from> <to type="permanent-redirect" last="true">http://host.opentext.com/content/</to> </rule> </urlrewrite>
Start the Apache Tomcat service.
Note: This configuration will redirect from
http://host.opentext.com/content, which will mask the Gateway Administration Console. To access the console, the host's IP address, or some other alias must be entered into the browser address bar.
When I add the filter to gateway web.xml and configure the rule as documented here or in "2.3 – Adding a URL Rewrite to AppWorks Gateway 16.2" (upgrade guide) it fixes the redirect issue from root to /content/, however, it also breaks Tempo notification functionality for gateway - new invites and test mail notification is no longer working.
There is some JAVA error in Tomcat logs, in my case it is following:
12-May-2017 14:12:00.055 WARNING [http-nio-8080-exec-6] org.glassfish.jersey.servlet.internal.ResponseWriter.suspend Attempt to put servlet request into asynchronous mode has failed. Please check your servlet configuration - all Servlet instances and Servlet filters involved in the request processing must explicitly declare support for asynchronous request processing. java.lang.IllegalStateException: A filter or servlet of the current chain does not support asynchronous operations.
Obviously, notification function is more important than redirect, but it would be still very good to have it in place. I believe that by altering the rewrite rule this could be fixed, however, i don't know what needs to be changed.
I've tried this in Gateway 16.1 and 16.2 and in both systems notification didn't work with filter enabled. I also tried to move the filter to different location in web.xml, moved it to the bottom as last filter, but it still didn't work.
Have you ever tested this rule to be compatible with all gateway functions? Maybe you already have correct rule configuration?
You need to sign in before voting.