annotate host/startup/nginx/nginx.default.conf.luan @ 1742:d778f1f2598a

make server side events proxy work
author Vadim Filimonov <fffilimonov@yandex.ru>
date Tue, 08 Nov 2022 09:32:46 +0200
parents 0344a535b1db
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
1 local rootDir, leKey = ...
0344a535b1db add doc
fffilimonov
parents:
diff changeset
2
0344a535b1db add doc
fffilimonov
parents:
diff changeset
3 %>
0344a535b1db add doc
fffilimonov
parents:
diff changeset
4 client_max_body_size 32m;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
5
0344a535b1db add doc
fffilimonov
parents:
diff changeset
6 proxy_http_version 1.1;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
7 proxy_set_header Host $http_host;
1742
d778f1f2598a make server side events proxy work
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1632
diff changeset
8 proxy_set_header Connection '';
d778f1f2598a make server side events proxy work
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1632
diff changeset
9
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
10 error_log <%=rootDir%>/logs/nginx_error.log;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
11
0344a535b1db add doc
fffilimonov
parents:
diff changeset
12 proxy_set_header X-Forwarded-Proto $scheme;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
13 proxy_set_header X-Real-IP $remote_addr;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
14
0344a535b1db add doc
fffilimonov
parents:
diff changeset
15 charset utf-8;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
16
0344a535b1db add doc
fffilimonov
parents:
diff changeset
17 location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$" {
0344a535b1db add doc
fffilimonov
parents:
diff changeset
18 default_type text/plain;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
19 return 200 "$1.<%=leKey%>";
0344a535b1db add doc
fffilimonov
parents:
diff changeset
20 }
0344a535b1db add doc
fffilimonov
parents:
diff changeset
21
0344a535b1db add doc
fffilimonov
parents:
diff changeset
22 location ~ /(?<path>.*) {
1742
d778f1f2598a make server side events proxy work
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1632
diff changeset
23 chunked_transfer_encoding off;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
24 proxy_cache_key $scheme$host$request_uri;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
25 proxy_cache nginx_cache;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
26 proxy_cache_revalidate on;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
27 proxy_cache_min_uses 1;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
28 proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
29 proxy_cache_background_update on;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
30 proxy_cache_lock on;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
31 add_header X-Cache-Status $upstream_cache_status;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
32 proxy_pass http://luan;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
33 }
0344a535b1db add doc
fffilimonov
parents:
diff changeset
34 <%