NETW 0014 Week 4, Day 3 — Nginx & TLS

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/17

encourage image

There are no tags or description

Looks like no tags are added yet.

18 Terms

1
New cards

How is How Nginx organized?

  • /etc/nginx/nginx.conf includes sites-enabled/*; you write sites in sites-available/ and enable them with a symlink (a deleted symlink is a disabled site)

  • nginx -t validates without touching the running server, and nginx -T prints the whole effective configuration

  • Reload (systemctl reload nginx) applies a changed config gracefully; a restart drops connections

  • Content lives under /var/www/ and must be readable by the www-data user


2
New cards

How does Nginx choose which block answers a request?

  • A request is matched first on the listen address and port, then on the Host header against server_name

  • If no name matches, the first block for that port (or one marked default_server) answers: this is why a wrong server_name shows you the wrong site, not an error

  • Leave the packaged default site enabled in sites-enabled: it is the block that answers when no server_name matches

  • The same block can serve both of S1's faces, because DNS views already send each audience to the right address

  • location blocks and try_files choose content; return 301 makes a redirect


3
New cards

What is a certificate?

A certificate is a public key plus names, signed by a CA

4
New cards

Why must a certificate carry subjectAltName?

Modern clients check the Subject Alternative Name (SAN), not the common name, so a certificate must carry subjectAltName or verification fails even if you trust it

5
New cards

How does a self-signed certificate work?

A self-signed certificate is signed by its own key: encryption works, but nobody vouches for identity until a client is told to trust it (by copying it to the client and using curl --cacert, or the system store)

6
New cards

How do you check what a server presents with?

openssl s_client -connect host:443

7
New cards

How do you check what a file contains?

openssl x509 -in file -noout -text

8
New cards

Why would production use a public CA such as Let's Encrypt?

It needs a name that resolves on the public internet and an inbound connection from the internet to prove control

9
New cards

Why is TLS 1.3 always forward secret?

it uses ephemeral key exchange, and the ssl_dhparam file plays no part

10
New cards

When does the Diffie-Hellman parameter file only matter?

he Diffie-Hellman parameter file only matters for the DHE cipher suites in TLS 1.2 and older, where a weak or default group is a risk

11
New cards

What does OCSP stapling do?

lets the server attach the CA's proof that its certificate has not been revoked, so clients do not have to ask the CA themselves. A self-signed certificate has no CA to ask, so ssl_stapling is off here: turning it on only produces warnings

12
New cards

Why should you always run nginx -t before reloading?

A bad certificate path stops a restart and takes every site on the server down

13
New cards

What is the likely cause and fix for the following issue: nginx -t: no such file (certificate, key or dhparam)

A path in a snippet does not match the file

List /etc/ssl and /etc/nginx; correct the path

14
New cards

What is the likely cause and fix for the following issue: Connection refused on 443

No HTTPS block, or the site was not enabled

ss -tlnp | grep nginx; check the symlink; nginx -T | grep listen

15
New cards

What is the likely cause and fix for the following issue: Port 80 still serves the page

The redirect block still has root or location lines

Keep only listen, server_name and the 301 return

16
New cards

What is the likely cause and fix for the following issue: curl still fails after trusting the certificate

The certificate has no SAN, or the name used is not in it

Recreate the certificate with the SAN and use a name listed in it

17
New cards

What is the likely cause and fix for the following issue: 403 for a file that exists

The files are not readable by www-data

Check ownership and permissions on the whole path

18
New cards

What is the likely cause and fix for the following issue: Partner gets the default page

The Host name used does not match a server_name

Use your domain or www with --resolve