Setting up namecheap domains with geroku

I have an application on heroku (paid dyno):

https://mysite.herokuapp.com/

I bought a domain:

www.mysite.com

After reading a few guides, I cannot figure out how to do the following:

  • domain for my heroku application (with SSL)
  • set up a subdomain, for example api.mysite.com

The overall goal is to have a domain like api.mysite.com

Thank. NOTE. Please do not just refer to documents with a hero and a hint. I read them all and they are outdated / nonspecific.

+4
source share
1 answer

- , , . SSL ACM ( ) heroku.

, SSL heroku.

  • , ACM

    $ heroku certs:auto -a [your app name]
    === Automatic Certificate Management is disabled on [your app name]
    
    Note: if you don't have heroku-toolbelt installed, just ignore this step. It just a check.
    
  • " SSL"
  • ACM ""
  • " ", api.mysite.com .
  • "DNS Target", - api.mysite.com.herokudns.com
  • $ heroku certs:auto -a [your app name]
    === Automatic Certificate Management is enabled on [your app name]
    

-, namecheap dns zonefile CNAME.

  • CNAME "api", api.mysite.com.herokudns.com( DNS- )

    TYPE        NAME        VALUE
    A           @           10.10.10.10                         <<< your www ip 
    CNAME       api         api.mysite.com.herokudns.com        <<< you need this one.
    
  • 10

  • api.mysite.com
+3

Source: https://habr.com/ru/post/1686676/


All Articles