سؤال

For an application hosted on Heroku that is still on the Bamboo stack myapp.heroku.com, how would you change over custom domains to point to the Cedar-compatible version myapp-cedar.herokuapp.com on the Cedar stack?

Here are the conditions that need to be dealt with:

  1. The applications cannot be assigned the same Heroku application name even if they are using different stacks.
  2. Bamboo uses .heroku.com while Cedar uses .herokuapp.com.
  3. Bamboo uses proxy.heroku.com to handle routing, and the custom domain name is pointed here. Cedar wants you to point to myapp-cedar.herokuapp.com.
  4. For Heroku to know the application a custom domain is for, the application needs to be assigned the custom domain name on the Heroku side of things. (For Cedar, this needs to be done in addition to pointing to myapp-cedar.herokuapp.com.)
  5. A custom domain name can only be assigned to one application at a time whether on Bamboo or Cedar. So on the Heroku side of things, there will be only one application serving a domain name.

I have submitted a ticket to Heroku support the other day asking if they allow by request two applications on Bamboo and Cedar to be assigned the same domain name. I doubt that they do this though.

Considering DNS propagation time, what is the best way to switch over to the Cedar application with least user inconvenience?

Let me know if this needs to be moved over to Server Fault.

Update:

We will follow the workaround suggested by Heroku support to use the SSL endpoint. The SSL endpoint serves HTTP too, and it seems they match based on the web request host and the custom domain assignments alone.

So it seems that pointing the custom domains to the endpoint, reassigning the custom domains from the Bamboo application to the Cedar application after the DNS changes have propagated, and then pointing to the correct Cedar subdomain again after the switch will do the trick.

Update:

We ended up just doing a straightforward DNS update with some downtime. TTL was set quite low, so the DNS changes were expected to propagate quickly enough for most users.

هل كانت مفيدة؟

المحلول

I would go like this:

  • create a CNAME record for a subdomain like cedar.example.com that points to your-cedar-app.herokuapp.com
  • add cedar.example.com to the cedar app domains
  • do a masked redirect of www.example.com to cedar.example.com
  • remove www custom domain from the bamboo app
  • add www domain to the cedar app
  • configure www to point to cedar
  • remove redirect from www

Hope that helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top