有ssl的heroku多个子域?

时间:2022-09-01 22:09:28

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.

我在heroku上有这个应用它的主要部分叫做app.example.com我在heroku上有自定义域,并为它添加端点ssl。都是工作。顺便说一下,最初的www.example.com非常古老,它托管在其他地方,而不是Heroku。

On heroku, I just

heroku,我只是

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

现在,我们有一个订单表单供用户在使用app. client之前订购,客户端希望将其url作为order.example.com而不是app.example.com/order。我从railscast查找了Rails中的路由约束来处理子域重定向,所以一切都很好。然后我将它添加到heroku的自定义域

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.

然后,我将www.example.com的原始主机上的CNAME更改为myapps.herokuapps.com(或其他)。现在访问order.example.com确实把我带到了order表单!只是https部分显示了通常的未验证的cert警告。

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)

于是我又给自己弄了另一个godaddy证书,但是现在当我尝试将证书添加到heroku(我之前在app。example.com的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)

向订单开发添加SSL端点…失败了!每个应用程序只允许一个SSL端点(试试certs:update)

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?

看起来我每个应用都不能有一个以上的SSL证书,这是否意味着我可以用我在app。example.com上的证书来做order。example.com ?如果有,我需要配置什么?还是我做错了,如果错了,我该怎么做呢?

Thank you for helping out here!

谢谢你的帮助!

1 个解决方案

#1


3  

You should buy wildcard certificate for *.example.com as opposed to multiple certs.

您应该购买*.example.com的通配符证书,而不是多个证书。

#1


3  

You should buy wildcard certificate for *.example.com as opposed to multiple certs.

您应该购买*.example.com的通配符证书,而不是多个证书。