RUN@cloud » Custom Application Domains

Custom Application Domains

Last modified by Michael Neale on 2014/04/10 01:40

Custom Application Domain Names

By default, applications deployed on RUN@Cloud will be assigned a cloudbees.net hostname based on the application name and your CloudBees username. If you already own an Internet domain that you previously purchased from a domain provider (like GoDaddy.com), you can setup your application to use your custom domain instead of the default cloudbees.net domain.

Configuring a custom application domain

Step 1 - Create a CNAME

To use your domain with CloudBees you'll need to update your domain's DNS record to point to your application's default domain name using a CNAME record. The tools for doing this will vary based on the DNS provider you use to manage your domain, but most providers should have some kind of web interface for creating a new CNAME record.

For example, let's assume I own the domain www.example.com, and I want to this custom domain for my application that currently uses the default domain myapp.demouser.cloudbees.net. I would need to goto my DNS provider's web interface and add a new CNAME for www.example.com and set its value to myapp.demouser.cloudbees.net.

CNAME: www.example.com = myapp.demouser.cloudbees.net

After updating your DNS record, you will need to wait for the DNS entry to propagate, which can take up to a day, but usually not more than an hour. After your DNS record has propogated, doing an nslookup command for www.example.com should then return the name myapp.demouser.cloudbees.net.

# nslookup www.example.com

Step 2 - Update your application configuration

Once your custom domain is setup to forward to the cloudbees.net domain (using a CNAME), you need to reconfigure your application to use www.example.com as a custom domain name.

  • Login to the console
  • Select your application
  • Open the configuration tab
  • Add your custom domain name to the domain name aliases text box
  • Click the save button
  • After your application is automatically redeployed, all requests to www.example.com will be forwarded to your CloudBees application.

You can also use the command line: bees app:proxy:update --alias www.boo.com,www.bar.com

Multiple domains

If you with to have multiple domain names associated with your app - comma delimit them in your configuration: 

ScreenShot2014-04-10at11.19.19am.png

A-record/apex/naked domain for your application

One limitation of DNS is that you can only use CNAMES for subdomains - so, for example, if you own the domain "cats.com" for your app - you would have to put a CNAME for www.cats.com to cats.you.cloudbees.net. If you want "cats.com" to go to your application - you can't use a CNAME - only an A record.  

Solutions:

1) Put an A record for the apex (root) to an IP that "cats.you.cloudbees.net" resolves to on lookup 

2) Use a service like DNSSimple ALIAS record for your domain that will create the A record and keep it updated for you. 

3) Use a redirection service that tells clients that go to cats.com to redirect to www.cats.com (you will note this is what google.com, facebook.com etc do) **.

The downside of #1 above is that is that YOU are responsible for keeping the A record IP address up to date - if that IP becomes unavailable or changes, you have to update it yourself (however it is quickest to start with). If you do this - please use a CNAME with a subdomain as well and ideally use that when you can (the naked one can be "for vanity" purposes). 

~** they don't direct literally to www.cats.com, but you know what I mean emoticon_wink

Wildcard domains

Wildcard domains (*.acme.com) are not supported by default, but this can be enabled for paid applications if you file a support ticket.  Be sure to include the wildcard pattern you'd like on your account when you file the ticket.

Naked domain redirection - redirect http://example.com to http://www.example.com

Preliminary notes

  • It is not a good practice to publish a web site on 2 different hostnames (e.g. example.com and www.example.com), it will have negative impact on Search Engine Optimization. The best practices is to publish a web site on 1 single hostname (e.g. www.example.com) and to do a redirection from 1 domain to the other (e.g. redirect example.com to www.example.com). This should be a 301 Permanent Redirect.
  • We recommend on CloudBees platform to not map applications to naked domains (e.g. example.com) and instead to map applications to subdomains (e.g. www.example.com) because naked domain do not support CNAME records.

Here are docs of various DNS providers on how to configure a naked domain redirection

Tags:
Created by Michael Neale on 2011/07/19 23:15