In this chapter
We'll learn how a name like blueticket.example reaches BlueTicket's servers safely — domains, DNS records, HTTPS certificates and reverse proxies — explained as a business's registered name, its listing in the phone book, an ID card and a receptionist.
The Problem in Real Life
For the new group-booking feature, Samantha wants a separate address for colleges: groups.blueticket.example. John gives the job to Anna. "You know DNS and HTTPS from Act 12, from the visitor's side. Now you'll set them up from the owner's side."
He adds a warning from experience: "Two years ago our certificate expired on a Saturday morning. Every browser showed a big red warning. Sales went to zero until someone woke up. Let's make sure that can't happen to this one."
Fans only see the name. Everything behind it is our job.
John
"Just Type the Address" vs. Everything That Makes It Work
Names, not numbers
Fans type names. Something has to point those names at the right servers.
Trust
Browsers block sites without a valid certificate. An expired one is as bad as none.
One door, many rooms
One address has to reach the right service: the website, the API, the group-booking pages.
Domains, DNS Records, HTTPS Certificates and Reverse Proxies
The business analogy: to be found by customers, a business needs a registered name, a listing in the phone book that says where it is, an official ID that proves it's really them, and a receptionist in the lobby who sends each visitor to the right office. A website needs the same four things.
- Domain — the registered name: a domain like
blueticket.exampleis a name BlueTicket rents yearly from a domain registrar. Under it, the owner can create subdomains freely:www,api,staging,groups. If the yearly payment is missed, the domain can expire — so auto-renew is always on. - DNS configuration — the phone-book listing: Act 12 showed DNS looking up a name. Here, you write the listings, called DNS records. An A record points a name to an IPv4 address (
groups.blueticket.example → 203.0.113.10). A CNAME record says "this name is an alias for that name" (www → blueticket.example). Changes can take minutes or hours to spread, because DNS answers are cached (Act 12's TTL). - HTTPS certificate — the official ID: for HTTPS (Act 12), the server must show a certificate proving it really owns the domain, signed by a certificate authority that browsers trust. Certificates expire — today, usually after 90 days or a year. Services like Let's Encrypt issue them for free and tools renew them automatically. An expired certificate shows every visitor a full-page warning.
- Reverse proxy — the receptionist: a reverse proxy (often Nginx, or the load balancer itself) sits in front of your application servers. Every request arrives there first. It handles HTTPS (so the app doesn't have to), routes each request to the right service by name or path (
/api/...to the API servers,groups.to the group pages), and can add caching, compression and limits. Users never talk to the app servers directly.
| Name | Type | Points to | Meaning |
|---|---|---|---|
| blueticket.example | A | 203.0.113.10 | The load balancer's address |
| www.blueticket.example | CNAME | blueticket.example | An alias for the main name |
| groups.blueticket.example | CNAME | lb.blueticket.example | Anna's new subdomain |
| staging.blueticket.example | A | 203.0.113.50 | The staging environment |
| Piece | Business version | If it goes wrong |
|---|---|---|
| Domain | Registered business name | Expired domain: the site disappears |
| DNS records | Phone-book listing | Wrong record: fans reach the wrong place, or nowhere |
| HTTPS certificate | Official ID card | Expired certificate: a full-page browser warning |
| Reverse proxy | Receptionist | Wrong route: requests reach the wrong service |
From a name to the right app server
Fan types groups.blueticket.example
in the browser
DNS: CNAME → lb.blueticket.example → 203.0.113.10
the phone-book listing
Reverse proxy / load balancer
shows the certificate, handles HTTPS, picks the route
Group-booking pages
groups.blueticket.example
API servers
paths starting /api/
Main website
everything else
server {listen 443 ssl;server_name groups.blueticket.example;ssl_certificate /etc/certs/blueticket.pem; # auto-renewed every 90 daysssl_certificate_key /etc/certs/blueticket-key.pem;location / {proxy_pass http://app_servers; # forward to the four app servers}}server {listen 80; # plain HTTPserver_name groups.blueticket.example;return 301 https://$host$request_uri; # always redirect to HTTPS}
Anna's setup for groups.blueticket.example: (1) In the DNS settings, she adds a CNAME record: groups → lb.blueticket.example (the load balancer's name), so if the load balancer's IP ever changes, nothing breaks. (2) She checks it with dig (Act 12's lookup tool). (3) She adds groups.blueticket.example to the certificate that auto-renews every 90 days, and adds an alert that fires 14 days before any certificate expires, in case auto-renew fails. (4) She adds a rule to the reverse proxy: requests for groups.blueticket.example go to the same app servers, which show the group-booking pages.
First test: she opens https://groups.blueticket.example. The padlock appears, the group-booking page loads. She opens http:// (without the s) — the reverse proxy automatically redirects her to https://. John checks the alert list and nods. "No more Saturday mornings."
Key Takeaway
A website needs a domain (the registered name, renewed yearly), DNS records that point names to servers (A records to IP addresses, CNAMEs as aliases), an HTTPS certificate (the ID card — it expires, so automate renewal and alert before expiry) and usually a reverse proxy (the receptionist that handles HTTPS and routes each request to the right service).
Why This Matters
Domains, DNS and certificates are where many real outages start — an expired certificate, a mistyped DNS record, a forgotten domain renewal. They're simple once you understand them, and every web developer eventually has to set up a subdomain, read a DNS record or debug a certificate warning.
Everything is set up — but how would the team know if something broke at 3 AM? On the day of the incident, it was a red screen on the wall that saved them. Anna wants to know how that screen knew.
