-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf.template
59 lines (50 loc) · 1.49 KB
/
nginx.conf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
map $LTO_TESTNET_NODE $lto_testnet_node {
default https://testnet.lto.network;
~^(.*)$ $1;
}
map $lto_testnet_node $lto_testnet_proxy {
~^(https?://[^/]+).*$ $1;
}
map $lto_testnet_node $lto_testnet_path {
~^https?://[^/]+(.*)$ $1;
}
map $LTO_MAINNET_NODE $lto_mainnet_node {
default https://nodes.lto.network;
~^(.*)$ $1;
}
map $lto_mainnet_node $lto_mainnet_proxy {
~^(https?://[^/]+).*$ $1;
}
map $lto_mainnet_node $lto_mainnet_path {
~^https?://[^/]+(.*)$ $1;
}
resolver ${NGINX_LOCAL_RESOLVERS};
server {
listen 80;
location ~ ^/1.0/identifiers/(did:lto:)?(3N|3M) {
rewrite ^/1.0/(.*) /$1 break;
proxy_pass $lto_testnet_node;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_next_upstream error timeout http_502;
}
location ~ ^/1.0/identifiers/(did:lto:)?3J {
rewrite ^/1.0/(.*) /$1 break;
proxy_pass $lto_mainnet_node;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_next_upstream error timeout http_502;
}
location / {
return 404;
}
}
#load_module /usr/lib/nginx/modules/ndk_http_module.so;
#load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;
#lua_package_path "/etc/lua/?.lua;;";
#lua_shared_dict my_cache 1m;
#pcre_jit on;