How to add subdomains in heroku in rails

╄→尐↘猪︶ㄣ 提交于 2019-12-13 15:26:42

问题


I have an app in ruby on rails which have multiple subdomains which on localhost are like this

manager.daycare.no:3000/
worker.daycare.no:3000/
daycare.no:3000/
admin.daycare.no:3000/
parent.daycare.no:3000/

Now I want to add these on heroku. How I add these sub domains on heroku?

My heroku-app name is sufa-travels.herokuapp.com/


回答1:


As I know, you cannot choose specific ports for configure your host in Heroku, also Heroku not supports DNS. But you can add custom domains and subdomains, and from your domain hosting settings, redirecting to Heroku app. Here is little shot from youtube Youtube

Heroku Doc says: Docs

$ heroku domains:add www.example.com`
Adding www.example.com to example... done
>
$ heroku domains:add blog.example.com`
Adding blog.example.com to example... done



回答2:


You can add a subdomain by using the heroku domains:add command.

https://devcenter.heroku.com/articles/custom-domains#add-a-custom-domain-with-a-subdomain



来源:https://stackoverflow.com/questions/36437632/how-to-add-subdomains-in-heroku-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!