My team has written an internal BI server, which generates HTML reports at links such as /users/daily
or /updates/questions
.
The server is written in Grails, and it works perfectly with a classic Apache-Tomcat setting:
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
So
https://example.com/users/daily
Is proxied internally to
http://localhost:8080/users/daily
And served from the Tomcat servlet.
The server is successful, and I would like to deploy it thrice, to 3 different systems, distinguished by a URL suffix (/dev
, /stg
, /prod
):
Meaning that https://example.com/dev/users/daily
will be proxied from http://localhost:8080/users/daily
, and https://example.com/prod/users/daily
will be served from http://localhost:8082/users/daily
.
I have tried some Apache RewriteRule
s and ProxyPass
rules, but could not find a working combination.
How can I do the suffix-based internal routing in Apache that with working internal links?