annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1630
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
1 local rootDir, domain = ...
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
2
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
3 %>
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
4 server {
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
5 server_name <%=domain%>;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
6 listen 80;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
7 return 301 https://$http_host$request_uri;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
8 }
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
9
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
10 server {
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
11 server_name <%=domain%>;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
12 listen 443 ssl;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
13
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
14 if ($host != $server_name) {
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
15 return 301 http://$http_host$request_uri;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
16 }
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
17
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
18 ssl_certificate <%=rootDir%>/sites/<%=domain%>/fullchain.cer;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
19 ssl_certificate_key <%=rootDir%>/sites/<%=domain%>/<%=domain%>.key;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
20 include <%=rootDir%>/local/nginx.default.conf;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
21 }
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
22 <%