Using Forge Subdomains0:01
So Forge has always done a great job of making it easy for us to manage attaching domains and subdomains to our forge sites. But something new in Forge 2.0, which I wanna get to first is the on dash forge domain that we get to create our own subdomains on for every single site we create. So if we were to go and create a new site, we can see that we have the option to choose our forge domain here.
and create a new site, we can see that we have the option to choose our forge domain here. And by default it'll pick the name of your repository, dash just some gibberish, but you can actually change this to be anything you want. You can call this layer cast tutorial production and you'll get that subdomain on on-forge.com functional for your app as long as you're still subscribed to Forge. Now you can choose a custom domain here, but I just wanted to point out that this is accessible
Now you can choose a custom domain here, but I just wanted to point out that this is accessible and customizable. So if we were to hit Create site right now, we are just gonna get this site set up at lair cast tutorial production.on-forge.com. And my experience, by the time it's done installing that subdomains actually ready, which is pretty impressive. I'm pretty sure it has to do with forges relationship with CloudFlare that it's
Adding a Custom Domain0:59
I'm pretty sure it has to do with forges relationship with CloudFlare that it's able to be up and running that quickly. And there we go. There's our site. Now if you want to add a custom domain, you click on the domains tab and there you can see the Forge domain you have assigned. You can edit it if you want, and then you can also add a custom domain. So let's add our custom domain tutorial
Configuring WWW Redirects1:13
and then you can also add a custom domain. So let's add our custom domain tutorial dot matt staffer.io, and when we hit add domain, we're gonna get a popup with some settings for how it handles subdomains. So the first section of subdomains is do we want to add www or not? There's three ways to handle this decision. Number one is don't add www tutorial dot matt staffer.io is the
Number one is don't add www tutorial dot matt staffer.io is the only thing that should serve here. The second option is redirect from www. So if somebody types www dot whatever domain we're adding, so www do tutorial Matt, staffer I io, it should redirect them to the non www version or we have redirect to www. So if you type this domain without www in front, it's gonna forward you over to the www version you choose.
Setting Wildcard Subdomains1:54
So if you type this domain without www in front, it's gonna forward you over to the www version you choose. But I would say that it's very common to use redirect from WW if you're on the root domain. So like matt staffer io.io and then do no redirect if you are on a subdomain, for example, tutorial tutorial.mattor.io. The second piece is wild cards and wildcard say, regardless of www or not, should we be serving subdomains underneath this one?
and wildcard say, regardless of www or not, should we be serving subdomains underneath this one? So this is tutorial.mattor.io. What happens if you type in blog.do or client four dot whatever else. If you want it to not support them, you keep it off. If you wanna support all domains, all potential subdomains underneath tutorial dot mass offer.io, then you click on on, and this is most commonly used when you do something like, um, you know, every single one
and this is most commonly used when you do something like, um, you know, every single one of your clients get a subdomain or something like that. And you can see that when we click on on, it's gonna take these op these options away and it's gonna do that because www is one of those wild card subdomains. So you can't actually make that choice. But when it's off, that's when you have the the choice to make the redirects here.
Pointing DNS ANAME Record2:56
But when it's off, that's when you have the the choice to make the redirects here. So again, by default, if it is a subdomain already, I'm gonna keep this off and I'm gonna say no redirect. The next thing we get is a modal from Forge saying point an A name record of this name over to this value. So we're gonna say tutorial matt, staffer.io, a name record to that IP address in about 15 minutes that should start serving. And once that happens, we have all of these other options,
in about 15 minutes that should start serving. And once that happens, we have all of these other options, we can visit it, we can copy it. We can also view that little modal popup. Again, we can edit those same configurations we had originally. We can add an SSL certificate. We can also make this the primary, which is a couple things that are important in Forge. But basically regardless of what you're doing with it,
which is a couple things that are important in Forge. But basically regardless of what you're doing with it, you should set whatever your primary domain is to be the primary. You can al also disable or delete one if it's not the primary and you have the same experience if you're creating a new site and adding a custom domain, right then. So if I were to be creating a new site and I don't want to use a forge domain, instead I'm going
So if I were to be creating a new site and I don't want to use a forge domain, instead I'm going to use a custom domain, I'm gonna say tutorial five, matt ur.io. When I click this change popup, it's that same modal we saw before. So again, I can say Wild cards off, no redirect, it's save. And then when we create that site, we immediately get that popup and we can go over to domains for that site and we can see that our custom domain is set up.
that popup and we can go over to domains for that site and we can see that our custom domain is set up. But here's a note that every single time you set up a custom domain and forge, you will still get this auto-generated one. It's just disabled by default. So you could choose to enable this one, you could choose to set as primary. You can also choose to name it and set it as a fallback one if you want.
Issuing SSL with Lets Encrypt4:39
You can also choose to name it and set it as a fallback one if you want. But note that even if you don't create a forge domain, you still get a forge domain. Alright, so let's go back to the first site we were working on and let's see what else we can do here. One of the most important other things that we can do to a domain is add a SSL certificate. So if you want to create it yourself,
to a domain is add a SSL certificate. So if you want to create it yourself, you can create the certificate signing request, pass it off to your registrar, and then they will give you back a certificate which you can install here. However, the most common circumstance is just to use Lets Encrypt. So let's try that out with Lets Encrypt. There are two verification methods, two public key algorithms, and then this one toggle.
There are two verification methods, two public key algorithms, and then this one toggle. You're almost certainly not gonna change this toggle, which has to do with the trust chain for Lets Encrypt unless you're dealing with a very specific bug. So just ignore it for now. There's also very little reason to choose RSA, which is very similar to E-C-D-S-A, but slower. So again, just stick with E-C-D-S-A unless you have a very specific reason not to.
So again, just stick with E-C-D-S-A unless you have a very specific reason not to. Now with DNS versus HTTP, you're probably familiar with the HTTP version where Let Encrypt requires Forge to set up basically a dot well-known slash a couple of other things to prove that we are who we say we are when we're asking for the Let Encrypt certificate. However, DNS allows to do it just purely through DNS records, which I actually prefer.
However, DNS allows to do it just purely through DNS records, which I actually prefer. So if we're gonna do it this way, we're just gonna grab this. We're gonna add a CNAME record with this value for with the time to live of 60 seconds. So we say add C name, paste that in, we grab the value, paste that in, and we only have uh, five minutes as our shortest one. We don't have 60 seconds, but that's fine.
and we only have uh, five minutes as our shortest one. We don't have 60 seconds, but that's fine. And we will see that this is verifying. So we can check back in in a few minutes when it's verified. And after a few minutes we see it as verified, which means we can now obtain certificate. And now we are set up. And if we go to tutorial dot matt staffer.io, we are on our site with an SSL cert up and running.
we are on our site with an SSL cert up and running.
