Search code examples
reverse-proxypaascloudbees

What configuration should be specified to bring different servers in same URL space in CloudBees PaaS


I am trying to use CloudBees PaaS (RUN@CloudBees) to consolidate essentially three different distinct uses under the same URL space:

  • root (/) main landing, marketing page
  • app (/app) java app running in CloudBees
  • blog (/blog) another java app running in cloudbees or possibly outside (example.wordpress.com)

If I was doing it myself in a datacenter or in AWS I would setup a reverse proxy (possibly like Varnish and configure reverse proxy to map the URL space as follows:

  • root (/): www.example.com/ --> CMS running as cloudbees app example-cms.cloudbees.net
  • app (/app) java app running in CloudBees www.example.com/app -> app.example.com
  • blog (/blog) similarly www.example.com/blog -> example.wordpress.com or exampleblog.cloudbees.net

How can I achieve the same with CloudBees. Can it be done? Is this too much to expect from a PaaS vendor?


Solution

  • An interesting problem, and a few solutions:

    1. Use domains instead of paths (eg blog.example.com etc) - so you can use DNS to direct things
    2. Build an app that essentially proxies traffic for you (this could run on cloudbees or elsewhere) - there are lots of ways to do this.
    3. Use some routing/proxy service (like CloudFlare) which may let you set up routing rules (so it can proxy traffic).

    My preference would always be for number 1 - DNS is a great way to do things like this. You can with this approach have /blog similar Urls in your paas application, and have it do a 302 redirect to the real blog.example.com - that kind of gives you a bit of both.