feat: enforce alphabetical server block ordering
Test nginx configuration / Static Analysis (pull_request) Failing after 6s
Test nginx configuration / nginx Syntax Check (pull_request) Successful in 24s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m59s

Adds test 13 to test.sh to verify that server blocks within each
sites-available file are sorted alphabetically by server_name
(LC_ALL=C; regex and wildcard entries excluded).

Fixes aria.conf and mommy.conf to conform: hyphenated names sort
before the bare domain in C locale ('-' < '.'), so trans-bot now
precedes trans, and mommy-slack now precedes mommy.
This commit is contained in:
2026-03-03 16:16:18 -08:00
committed by Naomi Carrigan
parent 493d758df8
commit 7085845234
3 changed files with 53 additions and 24 deletions
+11 -11
View File
@@ -34,6 +34,17 @@ server {
}
}
server {
listen 443 ssl;
server_name trans-bot.nhcarrigan.com;
ssl_certificate /etc/letsencrypt/live/trans.nhcarrigan.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/trans.nhcarrigan.com/privkey.pem;
location / {
return 301 https://aria.nhcarrigan.com;
}
}
server {
listen 443 ssl;
server_name trans.nhcarrigan.com;
@@ -45,14 +56,3 @@ server {
proxy_pass http://0.0.0.0:5000;
}
}
server {
listen 443 ssl;
server_name trans-bot.nhcarrigan.com;
ssl_certificate /etc/letsencrypt/live/trans.nhcarrigan.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/trans.nhcarrigan.com/privkey.pem;
location / {
return 301 https://aria.nhcarrigan.com;
}
}
+13 -13
View File
@@ -11,19 +11,6 @@ server {
}
}
server {
listen 443 ssl;
server_name mommy.nhcarrigan.com;
ssl_certificate /etc/letsencrypt/live/mommy.nhcarrigan.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mommy.nhcarrigan.com/privkey.pem;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8008;
proxy_redirect off;
}
}
server {
listen 443 ssl;
server_name mommy-slack.nhcarrigan.com;
@@ -36,3 +23,16 @@ server {
proxy_redirect off;
}
}
server {
listen 443 ssl;
server_name mommy.nhcarrigan.com;
ssl_certificate /etc/letsencrypt/live/mommy.nhcarrigan.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mommy.nhcarrigan.com/privkey.pem;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8008;
proxy_redirect off;
}
}