[英]Pointing a custom path on my domain to Heroku app
I have two Heroku apps: 我有两个Heroku应用程序:
example-api.herokuapp.com
example-web.herokuapp.com
I also have my own domain example.com
managed by Google Domains 我也有自己的网域
example.com
,由Google Domains管理
So I would like to point: 所以我想指出:
subdomain.example.com -> example-web.herokuapp.com
subdomain.example.com/api -> example-api.herokuapp.com
Is that possible? 那可能吗? And if so, how?
如果是这样,怎么办?
I'm aware that this structure may seem weird, but I wanted to clearly separate API and Web in two different repositories, hence two separate Heroku apps. 我知道这种结构可能看起来很奇怪,但是我想在两个不同的存储库中清楚地将API和Web分开,因此需要两个单独的Heroku应用程序。
Thanks very much in advance. 首先十分感谢。
EDIT: I have already managed to do the first part (pointing subdomain.example.com
to example-web.herokuapp.com
) 编辑:我已经设法做第一部分(将
subdomain.example.com
指向example-web.herokuapp.com
)
This cannot be done with DNS, this should be done by reverse proxying, but not recommended for APIs. 使用DNS无法做到这一点,应该通过反向代理完成,但不建议用于API。
How about use api.example.com -> exame-apo.herokuapp.com
? 如何使用
api.example.com -> exame-apo.herokuapp.com
? It's more elegant solution for api subdomains 它是针对api子域的更优雅的解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.