This proxy helps us keep friendly URLs even when there are composite UIs or composite microservice REST APIs. Ticket Monster UI uses a simple HTTP server (Apache) to serve the static content and then use the reverse proxy plugins to proxy REST calls to the appropriate microservice:
Reverse proxy defined in httpd.conf:
# proxy for the admin microserivce
ProxyPass "/rest" "http://ticket-monster.YOUR-SYSTEM-DOMAIN.com/rest"
ProxyPassReverse "/rest" "http://ticket-monster.YOUR-SYSTEM-DOMAIN.com/rest"
- Requires access to a PCF Cluster
- Make sure you have Cloud Foundry CLI installed
- You need Docker to create a Docker image
- Sign In to your DockerHub Account
This rule randomly routes traffic to either tm-ui-v1 or the UI of ticket-monster by a 50% chance. Besides, it set the http request header X-Canary depending on the target UI.
0. Clone the repository and change directory
$ cd tm-ui-v1
1. Build Docker image
$ docker build -t <your dockerhub account>/tm-ui:monolith .
2. Push Docker image to DockerHub
$ docker push <your dockerhub account>/tm-ui:monolith
3. Push the application to Cloud Foundry by refering to the image on DockerHub
$ cf push tm-ui-v1 -o <your dockerhub account>/tm-ui:monolith