This course has been updated! We now recommend you take the Full Stack for Front-End Engineers, v2 course.
Transcript from the "Nginx Setup: Adding a domain name and opening port 443" Lesson
>> Jem Young: Okay, so we're up and running. What was the next task? Add a domain name. Okay, I can do that. And we're adding domain name just to make it easier cuz we're gonna use something called certbot to make a certificate for us. And it does nginx configuration for you, which is awesome.
[00:00:16] But first we need to edit our nginx config so it knows where to make a certificate for. So I'm just gonna say oops, sudo vi /etc/nginx/sites-available/defaults.
>> Jem Young: On the bottom and the top.
>> Jem Young: Yeah, we should be good, so let's edit the server name.
>> Jem Young: And I'm going to say, jem.party, yeah, www.jem.party.
[00:00:50] Obviously, use your own domain. If you're using jem.party, don't know why. I love the party domain. I don't know why it's the real thing.
>> Speaker 2: [LAUGH]
>> Jem Young: I feel like it's the end of the Internet. We're just like, yeah, let's ma domain to that, but whatever, jem.party.
>> Jem Young: Everybody with me?
[00:01:08] I added the server name configuration. It's usually just an underscore blank. I think I have a slide for it. I do. So just add a server name, don't forget the semicolon. Don't know why I didn't put a semicolon in there, semicolon.
>> Jem Young: All right, cool. And let's go ahead and reload nginx again.
[00:01:34] And we're still good. And what was the last step? It was open port 443. So let's say, sudo ufw allow 443. Cool.
>> Jem Young: Let's try to do the rules. Look at the man page.
>> Jem Young: Status, that's what I wanted. ufw status.
>> Jem Young: And let's bring it up.
>> Jem Young: Yes.
[00:02:26] Aborted? Why?
>> Jem Young: Maybe I didn't add nginx rule. sudo ufw allow ssh, yeah.
>> Jem Young: Just make sure our firewall is properly config. Binary set status, yeah.
>> Jem Young: Cool, so now should be,
>> Jem Young: All right, it's showing our open ports, if you have sudo uwf status. If you haven't brought ufw up, so sudo ufw enable to start ufw.
[00:03:27] Otherwise, it's gonna fall back to the default IP table rules. Which are pretty good, but we wanna switch over to the Uncomplicated Firewall. And we see we have port 443, which is HTTPS port. We have port 22, it's SSH. Then we have IPv6, the rules for those as well.
>> Jem Young: All right, we all good so far. Any questions?
>> Jem Young: All right, cool, and we added our server name. This will just make it easier in the future when we add the certbot to it.