1/17
Looks like no tags are added yet.
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
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
What is a certificate?
A certificate is a public key plus names, signed by a CA
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
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)
How do you check what a server presents with?
openssl s_client -connect host:443
How do you check what a file contains?
openssl x509 -in file -noout -text
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
Why is TLS 1.3 always forward secret?
it uses ephemeral key exchange, and the ssl_dhparam file plays no part
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
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
Why should you always run nginx -t before reloading?
A bad certificate path stops a restart and takes every site on the server down
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
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
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
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
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
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