我有一个heroku应用程序(无论-app-11123),我想通过ssl(https://myapp.co)使用自定义域名。 我已经购买了证书,并按照heroku提供的所有说明进行操作。 奇怪的是,https://whatever-app-11123显示myapp.co证书,https://myapp.co显示* .herokuapp.com证书。
我需要将此作为另一种方式:myapp.co with myapp.co certificat。
有关如何实现这一目标的任何提示?
不同命令的结果:
herok:证书
Endpoint Common Name(s) Expires Trusted
--------------------------------- ---------------------------------------- -------------------- -------
whatever-app-11123.herokuapp.com myapp.co, www.myapp.co 2017-02-12 23:59 UTC True
curl -kvI https://www.myapp.co
* Adding handle: conn: 0x7fbd03804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fbd03804000) send_pipe: 1, recv_pipe: 0
* About to connect() to www.myapp.co port 443 (#0)
* Trying 46.132.168.142...
* Connected to www.myapp.co (46.132.168.142) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.herokuapp.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> HEAD / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: www.myapp.co
> Accept: */*
>
< HTTP/1.1 302 Found
HTTP/1.1 302 Found
* Server Cowboy is not blacklisted
<
* Connection #0 to host www.myapp.co left intact
答案 0 :(得分:0)
以下是答案:检查您的DNS重定向。确保它是一个CNAME类型和最重要的(我做错了)重定向应该是:
www.myapp.co -> whatever-app-11123.herokuapp.com
myapp.co -> whatever-app-11123.herokuapp.com
而不是
www.myapp.co -> myapp.co
myapp.co -> whatever-app-11123.herokuapp.com