Installing a certificate on a subdomain


I am trying to install a certificate for an app I have hosted on as a subdomain of another site. I deployed the site and it’s reachable from the * domain. The primary domain is hosted on Godaddy, so I went there and added a CNAME record to point the subdomain to my fly app. When I attempt to navigate to the subdomain, it said the connection was closed, which I assume was because I didn’t have a certificate installed for the subdomain. I did fly “certs create”, but got some warnings:
A Record (###) does not match app’s IP ()
AAAA Record (###) does not match app’s IP ()
Address resolution (###) does not match app’s IP (/)
Address resolution (###) does not match app’s IP (/)

It hinted that I should add a CNAME record - but the CNAME record it suggested was exactly what I had already added. To test this, I pinged the address, and noted the IP. Then I used nslookup on my domain and the IP addresses matched. So the DNS is working, but for some reason the certificate installation mechanism thinks it is not.

In case someone runs into a similar situation, the problem was I added the cert to the wrong app. I have a project that has two apps associated with it, the normal production one my-app, and then a staging version called my-app-staging. When you use the fly certs create command, it defaults to the primary production app, but I was adding a cert for the staging version. Once I realized I could specify which app the cert was for with the --app flag, all was well.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.