annotate host/startup/nginx.default.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, leKey = ...
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 client_max_body_size 32m;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
5
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
6 proxy_http_version 1.1;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
7 proxy_set_header Host $http_host;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
8 error_log <%=rootDir%>/logs/nginx_error.log;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
9
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
10 proxy_set_header X-Forwarded-Proto $scheme;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
11 proxy_set_header X-Real-IP $remote_addr;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
12
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
13 charset utf-8;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
14
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
15 location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$" {
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
16 default_type text/plain;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
17 return 200 "$1.<%=leKey%>";
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
18 }
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
19
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
20 location ~ /(?<path>.*) {
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
21 proxy_cache_key $scheme$host$request_uri;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
22 proxy_cache nginx_cache;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
23 proxy_cache_revalidate on;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
24 proxy_cache_min_uses 1;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
25 proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
26 proxy_cache_background_update on;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
27 proxy_cache_lock on;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
28 add_header X-Cache-Status $upstream_cache_status;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
29 proxy_pass http://luan;
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
30 }
b735ed134662 add nginx and ssl for host
fffilimonov
parents:
diff changeset
31 <%