简体   繁体   English

如何在heroku上为应用程序创建子子域:(例如sub.myapp.herokuapp.com)

[英]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中使用子域名

Full Details here 完整细节在这里

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.

相关问题 Rails 3:使用myapp.herokuapp.com作为URL构建基础的Heroku应用程序 - Rails 3 : Heroku app using myapp.herokuapp.com as base for URL building 在herokuapp.com上的Heroku应用程序中,cookie是否安全? - Are cookies safe in a Heroku app on herokuapp.com? 托管在heroku上时,对api.myapp.com的请求会比对api-myapp.herokuapp.com的请求慢吗? - Will a request to api.myapp.com be slower then a request to api-myapp.herokuapp.com when hosted on heroku? 在缓存或CDN的帮助下提高Heroku Dynos启动的性能(例如cloudflare.com) - Increasing performance of Heroku Dynos startup with the Help of Caching or a CDN (e.g. cloudflare.com) 如何配置我的Heroku应用程序以限制对其特定服务器的herokuapp.com域的访问? - How to config my Heroku app to restrict the access to it's herokuapp.com domain a specific server? 是否可以禁止访问myapp.herokuapp.com? - Is it possible to disallow access to myapp.herokuapp.com? 我是否需要HTTP服务器(例如Express,Nginx等)才能在Heroku上使用React应用? - Do I need an HTTP server (e.g. Express, Nginx, etc.) for react app on Heroku? Heroku:我可以让一个应用程序指向myapp.com/,另一个应用程序指向myapp.com/something吗? - Heroku: Can I have one app pointing to myapp.com/ and another app to myapp.com/something? 如何在Heroku,Rackspace和AWS上运行pypy的最新版本(例如2.3.1)? - How to run a recent version of pypy (e.g., 2.3.1) on Heroku, Rackspace, AWS? 如何将stanford coreNLP服务器部署到在线Web服务(例如Heroku)? - how to deploy stanford coreNLP server to an online webservice e.g. Heroku?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM