feat: add catch-all server blocks for unmatched subdomains
Test nginx configuration / Static Analysis (push) Failing after 4s
Test nginx configuration / nginx Syntax Check (push) Successful in 17s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m21s

 This commit was made with help from Hikari~ 🌸
This commit is contained in:
2026-03-10 12:16:17 -07:00
committed by Naomi Carrigan
parent f3f65e9d92
commit 2b8748fddb
2 changed files with 29 additions and 7 deletions
@@ -0,0 +1,22 @@
# Catch-all for unmatched subdomains - serves a 404 page.
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/letsencrypt/live/nhcarrigan.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nhcarrigan.com/privkey.pem;
server_name _;
root /home/naomi/404;
error_page 404 /index.html;
location / {
return 404;
}
location = /index.html {
internal;
}
}
+7 -7
View File
@@ -2,17 +2,17 @@ server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
root /home/naomi/404;
error_page 404 /index.html;
location / {
try_files $uri $uri/ =404;
return 404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
location = /index.html {
internal;
}
}