[英]How to create a subsubdomain for an app on heroku: (e.g. sub.myapp.herokuapp.com)
I am running a multi tenant app that uses subdomains for tenants on Heroku. 我正在运行一个多租户应用程序,它在Heroku上为租户使用子域名。 In production I have a domain where subdomains point to my heroku app.
在制作中,我有一个域名,子域名指向我的heroku应用程序。 (This all works fine)
(这一切都很好)
For staging, I'd like to test without creating another domain. 对于暂存,我想测试而不创建另一个域。 Since my app uses the first subdomain it sees to find the current tenant, I was hoping to use a url like: tenant.myapp.herokuapp.com.
由于我的应用程序使用它看到的第一个子域来查找当前租户,因此我希望使用以下网址:tenant.myapp.herokuapp.com。 However, this is not working (heroku returns a 'no such app' error.)
但是,这不起作用(heroku返回'没有这样的应用程序'错误。)
I've found this post from 2 years ago that says it should be possible, but I don't see this add-on/option anymore in the referenced documentation. 我在2年前发现这篇帖子说它应该是可能的,但我在引用的文档中不再看到这个附加/选项。
I have tried adding the subdomains as a wildcard in heroku by running 我已经尝试通过运行将子域添加为heroku中的通配符
heroku domains:add *.myapp.herokuapp.com
but this returned 但是这回来了
! Trying to hijack another Heroku app? Tsk, tsk.
Does anyone know if this can still be accomplished and if so, how? 有谁知道这是否仍然可以完成,如果是这样,怎么样?
note: I'm currently using my staging environment by CNAMING *.staging.myapp.com to myapp.heroku.com, but would like to clean that up. 注意:我目前正在使用我的暂存环境CNAMING * .staging.myapp.com到myapp.heroku.com,但是想要清理它。
Here's how you use subdomains with heroku 以下是您如何在heroku中使用子域名
Custom subdomains
自定义子域
For each custom subdomain you want to attach to your app (for example, www.example.com), use the
domains:add
command from the Heroku CLI:对于要附加到应用程序的每个自定义子域(例如,www.example.com),请使用Heroku CLI中的
domains:add
命令:
$ heroku domains:add www.example.com`
Adding www.example.com to example... done
This is no longer valid: "Subdomains are currently not possible on heroku" 这已不再有效: “目前无法在heroku上使用子域名”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.