Need to setup heroku app on my domain server - ruby-on-rails

Let me explain my needs.
I have an apps on heroku.com
Now I have my own domain on bluehost.com
Need to setup these heroku app on my domain.
means when I visit on mydomain.com url, its use heroku app not redirect on just work with my mydomain.com links.
Thanks

Heroku provides detailed docs on how to setup custom domains for your apps.
In a nutshell, you'll want to setup a www subdomain, redirect your naked domain to the www subdomain (mydomain.com -> www.mydomain.com), add a CNAME to the www subdomain pointing at your app (www.mydomain.com -> myapp.heroku.com), and add the www subdomain to the Heroku app (heroku domains:add www.mydomain.com).
There are other ways to set up a custom domain on a Heroku app, which the docs go into detail about. But the above is the most common.

Related

How to allow users to point a custom domain to a subdomain of me app

I have an app where when users sign up, their content resides on a subdomain of my app, something like:
user1.example.com
Now I want them to be able to point their custom domain to this subdomain, so that when you visit user1s-domain.com you see the content that was on user1.example.com
The app is a Ruby on Rails app, currently hosted on Heroku. I'm happy to move it to AWS if I can't do what I need on Heroku.
Can you please advise on how this would be accomplished?
Heroku requires you to configure your account ahead of time with the domain(s) you want to serve. If your app was running on an EC2 server on AWS you could configure your server to accept any domain, at which point the user could point CNAME records to their subdomain.

CloudFlare SSL + Heroku custom domain not working

It's been more than 48 hours after I update my CloudFlare DNS setting to point to my Heroku app. The custom domain works fine now without https://.
But when I try the https:// version, I get this:
This is my Heroku custom domain setting:
This is my CloudFlare DNS setting:
This is my CloudFlare SSL setting:
And lastly, this is my CloudFlare page rules setting:
I follow this CloudFlare guide and not skip any step of it.
What am I missing here?
My app (http): http://beta.futurelab.my/
My app (https): https://beta.futurelab.my/
My Heroku app: http://future-lab-production.herokuapp.com OR https://future-lab-production.herokuapp.com
I want my app only available at https://beta.futurelab.my/ and force SSL sitewide.
Please help.
Seems like you added the CNAME record to Cloudflare but not enabled it. You need to click on the cloud icon placed on the right of your Cloudflare DNS record row. It should turn to orange when it is enabled.
Hope it helps.

Custom domain not working correctly on heroku rails app

I have a domain on godaddy and i want to put it in action on my heroku application i followed this video and it worked correctly but the problem is that i can only access my website at www.example.com and when i call for example.com it takes me to a godaddy page saying:
"You've registered your domain.Now put it to work."
and when i tried https://example.com or http://example.com it got me error
Any help?
By default example.com is an independent domain from www.example.com.
What you need to do is set up a static redirect or domain forwarding from example.com to www.example.com.
You should be able to do this in your GoDaddy's administration panel. Here's a tutorial.

Rails Heroku custom domain with Facebook login - Given URL is not allowed

I'm having trouble getting Heroku custom domain to play well with the Facebook oauth login
I am getting the error
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
which is examined in various threads including the Facebook one
https://www.facebook.com/help/community/question/?id=542958419109491
So far, my setup is this
the root
http://domain.com is redirect to to http://www.domain.com
The cnames have been changed for www.domain.com so it is an alias for my heroku app. Shows up fine.
https://devcenter.heroku.com/articles/custom-domains There does say
"Zone apex domains (aka “naked”, “bare” or “root” domains), e.g., example.com, using conventional DNS A-records are not supported on Heroku. However, there are alternative configurations that allow for root domains while still being resilient in a dynamic runtime environment."
but I don't know how this effects FB login
When I click the facebook login, it'll throw that error. I've tried various setups in my app settings including with and without the www
Right now, I've left it as
App domain: domain.com
Site URL: http://domain.com
Mobile site URL: http://domain.com
Embedded browser OAuth Login is enabled
(I've tried www for all the options above, but maybe there is a combination I haven't tried. I'm really just doing it randomly not knowing why one would work over another)
If I can't resolve this, I might try opening an issue on Facebook tomorrow.
This final combination seemed to work as my site is coming from www.domain.com
App domain: domain.com
Site URL: http://www.domain.com
Mobile site URL: http://www.domain.com
Embedded browser OAuth Login is enabled
Redirect uri in Advanced setting also added http://www.domain.com

heroku multiple subdomains with ssl possible?

I have this app on heroku the main part of it is called app.example.com for which I have custom domains on heroku, and added endpoint ssl to it. it's all working. By the way, the original www.example.com is very old, and it is hosted somewhere else not on Heroku.
On heroku, I just
heroku domains:add app.example.com
Now, we have an order form for user to order stuff before they get to use the app. and the client wants to have its url as order.example.com instead of app.example.com/order. I looked up routing constraint in Rails from RailsCasts to handle this subdomain redirect, so all's good. then I add it to heroku's custom domains
heroku domains:add order.example.com
then I change the CNAME on the original host of www.example.com to have it point order.example.com to myapps.herokuapps.com (or something). And now accessing order.example.com does bring me to the order form! Just that the https part is showing the usual non-verified cert warning.
So I went ahead and got myself another godaddy certificate, but now when I try to add the certificate to heroku (I have done this once before for app.example.com's https)
heroku certs:add ~/ssl/combined.crt ~/ssl/nopass.key
Adding SSL endpoint to order-dev... failed
! only one SSL endpoint allowed per app (try certs:update instead)
So it seems like I can't actually have more than one SSL certificate per app, does that mean I can actually use what I have for certificate for app.example.com for order.example.com also? If so, what do I have to configure? Or am I doing this all wrong, if so, what should I have done instead?
Thank you for helping out here!
You should buy wildcard certificate for *.example.com as opposed to multiple certs.

Resources