diff host/startup/nginx/nginx.conf.luan @ 2133:c3b4c19f2d8a

attempt to autodetect and use nginx confs dir
author Violet7
date Fri, 16 Jan 2026 17:29:05 -0800
parents 6a2383baecb6
children de3107eb911f
line wrap: on
line diff
--- a/host/startup/nginx/nginx.conf.luan	Fri Jan 16 16:56:38 2026 -0800
+++ b/host/startup/nginx/nginx.conf.luan	Fri Jan 16 17:29:05 2026 -0800
@@ -1,4 +1,4 @@
-local rootDir, user, group = ...
+local luanhostDir, nginxConfigDir, user, group = ...
 
 %>
 	proxy_cache_path /usr/local/nginx_cache levels=1:2 keys_zone=nginx_cache:60m max_size=10g inactive=60m use_temp_path=off;
@@ -7,17 +7,17 @@
 		# nginx usually has one at /etc/nginx/sites-enabled/default
 		listen 80 default_server;
 		listen [::]:80 default_server;
-		include <%=rootDir%>/local/nginx.default.conf;
+		include <%=nginxConfigDir%>/nginx.default.conf;
 
 		location /.well-known/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/;
+			alias <%=luanhostDir%>/sites/$host/ssl/acme-challenge/;
 			try_files $uri $uri/ =404;
 		}
 	}
 
 	# 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;
+	include <%=luanhostDir%>/sites/*/ssl/nginx.ssl.conf;
 <%