Hi there,
We have a portal module, so the URL for the portal app needs an “app-portal” in the url, e.g localhost:8080/app-portal.
We also have a domain name, which hides the “app-portal” from the URL in the browser by website redirect configuration on DNS server. For example, say our domain is example.com. When I go to example.com, it’ll show “example.com” in the browser but internally it is ultimately redirected to our local tomcat server: “192.168.1.xx:8080/app-portal”.
Right now, as we’re still in developing mode, i.e., every request and resource URL need “app-portal” explicitly specified, e.g. AJAX →
localhost:8080/app-portal/someRequest
or
<script src="/app-portal/resources/............"></script>
. But now, with the domain name, we don’t need the app-portal anymore as the domain already includes it, so the new resource URL should be
<script src="/resources/.........."></script>
.
If we do that by removing “/app-portal” from
<script src="/app-portal/resources/............"></script>
, the resource retrieving works. However, in our portal-spring-security.xml we have a form-login tag, to allow users log in. The “default-target-url” attribute is set to “/bo/bo”. In this “development” mode, the portal app URL is “localhost:8080/app-portal”, and it resolves to “localhost:8080/app-portal/bo/bo” by prepending “app-portal” to “/bo/bo”.
However, in production, when I am on “example.com” and log in, the URL ultimately ends up at tomcat server becomes “192.168.1.xx:8080/app-portal/app-portal/bo/bo” after login. Notice the double app-portal.
Is there a way in CUBA platform to disable this automatic prepending of “app-portal”, most preferably throughout the entire system? I was thinking there might be some global configuration flag to change CUBA from “development” to “production” mode when deploy to Tomcat, or I should configure DNS differently to make the Cuba portal app working?
If the solution needs a nginx kind of reverse proxy sitting in front of Tomcat, we can also do that.
Thank you,
-Mike