diff host/startup/nginx.ssl.conf.luan @ 1630:b735ed134662

add nginx and ssl for host
author fffilimonov
date Fri, 10 Dec 2021 17:08:17 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/host/startup/nginx.ssl.conf.luan	Fri Dec 10 17:08:17 2021 +0000
@@ -0,0 +1,22 @@
+local rootDir, domain = ...
+
+%>
+	server {
+		server_name <%=domain%>;
+		listen 80;
+		return 301 https://$http_host$request_uri;
+	}
+
+	server {
+		server_name <%=domain%>;
+		listen 443 ssl;
+
+		if ($host != $server_name) {
+			return 301 http://$http_host$request_uri;
+		}
+
+		ssl_certificate <%=rootDir%>/sites/<%=domain%>/fullchain.cer;
+		ssl_certificate_key <%=rootDir%>/sites/<%=domain%>/<%=domain%>.key;
+		include <%=rootDir%>/local/nginx.default.conf;
+	}
+<%