diff host/startup/nginx/nginx.conf.luan @ 2117:1e247cd012ee ssltesting

use site_dir/ssl for all ssl related files; raise error() on empty acme-tiny output.
author Violet7
date Tue, 06 Jan 2026 09:01:44 -0800
parents 0d247a84c26d
children
line wrap: on
line diff
--- a/host/startup/nginx/nginx.conf.luan	Mon Jan 05 14:02:55 2026 -0700
+++ b/host/startup/nginx/nginx.conf.luan	Tue Jan 06 09:01:44 2026 -0800
@@ -27,11 +27,15 @@
 		include nginx.default.conf;
 
 		location /.well-known/acme-challenge/ {
-			alias <%=rootDir%>/sites/$host/acme-challenge/;
+			# $host/ssl does not exist for non-ssl sites and requests to here
+			# will fail with 404 for those sites, which is what we want
+			alias <%=rootDir%>/sites/$host/ssl/acme-challenge/;
 			autoindex on;
 		}
 	}
 
-	include <%=rootDir%>/sites/*/nginx.ssl.conf;
+	# glob pattern returns no results for site dirs that don't have 
+	# the ssl/ subdir, so this is ok
+	include <%=rootDir%>/sites/*/ssl/nginx.ssl.conf;
 }
 <%