Custom domains and naked domains with openshift apps

on Note Written by Sirwan Qutbi.

A tutorial on how to get openshift app domains to work with and without .www. As part of this example, this tutorial will use the openshift domain name world and the app name hello.

Add domain alias to openshift

Navigate to your application in the web console, and add 2 aliases to your domain. Add one with a www then add another without. So you should have 2 aliases to your app's domain. i.e www.hello.com and hello.com.

Sign up to CloudFlare

Sign up at CloudFlare.com and add your domain as hello.com.

Configure CloudFlare

Now we need to configure CloudFlare so it just works. Go to your DNS settings in CloudFlare. Remove all the default rules added by CloudFlare.

Now add the following rules for your respective domain to your CloudFlare DNS records.

  • type: CNAME. name: *. value: hello.com
  • type: CNAME. name: hello.com. value: hello-world.rhcloud.com
  • type: CNAME. name: www. value: hello-world.rhcloud.com

Leave all the TTL column set as Automatic.

If your stuck dont hesitate to email me at [email protected]