Update nginx and mempool backend configuration for active failover HA

This commit is contained in:
wiz
2021-02-22 20:22:03 +09:00
parent 795fb9342a
commit c9f2bd4029
7 changed files with 60 additions and 37 deletions

View File

@@ -33,9 +33,6 @@
# fallback for all URLs i.e. /address/foo /tx/foo /block/000
location / {
# if ($http_user_agent ~* "(Google|Bing|Yandex|Slack|Keybase|Twitter)") {
# proxy_pass https://node202.mempool.space;
# }
try_files /$lang/$uri /$lang/$uri/ $uri $uri/ /en-US/$uri @index-redirect;
}
location @index-redirect {
@@ -60,7 +57,7 @@
}
# old /explorer redirect from v1 days
location /explorer {
try_files $uri =410;
rewrite /explorer/(.*) https://$host/$1 permanent;
}
# static API docs
@@ -107,11 +104,11 @@
# mainnet API
location /api/v1/donations {
proxy_pass http://127.0.0.1:9001;
proxy_pass https://node220.bitcoin.wiz.biz;
# don't rate limit this API prefix
}
location /api/v1/donations/images {
proxy_pass http://127.0.0.1:9001;
proxy_pass https://node220.bitcoin.wiz.biz;
proxy_cache cache;
proxy_cache_valid 200 1d;
}
@@ -125,6 +122,18 @@
proxy_pass http://127.0.0.1:8999/api/v1;
limit_req burst=50 nodelay zone=api;
}
location /api/address {
proxy_pass http://electrs-mainnet/address;
limit_req burst=50 nodelay zone=electrs-address;
}
location /api/tx {
proxy_pass http://electrs-mainnet/tx;
limit_req burst=50 nodelay zone=electrs-tx;
}
location /api/block {
proxy_pass http://electrs-mainnet/block;
limit_req burst=50 nodelay zone=electrs-block;
}
location /api/ {
proxy_pass http://electrs-mainnet/;
limit_req burst=50 nodelay zone=electrs;
@@ -198,7 +207,7 @@
limit_req burst=50 nodelay zone=electrs;
}
# mainnet API
# websockets
location /ws {
proxy_pass http://127.0.0.1:8999/;
proxy_http_version 1.1;
@@ -223,3 +232,9 @@
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /ws/signet {
proxy_pass http://127.0.0.1:8995/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}