Update nginx.conf for signet, services, and disable SSR for now

This commit is contained in:
wiz 2021-02-21 03:39:19 +09:00
parent 279cba5d79
commit 7195d6ea31
No known key found for this signature in database
GPG Key ID: A394E332255A6173
2 changed files with 44 additions and 6 deletions

View File

@ -33,6 +33,9 @@
# 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 {
@ -57,7 +60,7 @@
}
# old /explorer redirect from v1 days
location /explorer {
rewrite /explorer/(.*) https://$host/$1 permanent;
try_files $uri =410;
}
# static API docs
@ -93,14 +96,22 @@
#return 302 https://mempool.space/$request_uri;
try_files $uri $uri/ /en-US/index.html =404;
}
location = /signet/api {
#return 302 https://mempool.space/$request_uri;
try_files $uri $uri/ /en-US/index.html =404;
}
location = /signet/api/ {
#return 302 https://mempool.space/$request_uri;
try_files $uri $uri/ /en-US/index.html =404;
}
# mainnet API
location /api/v1/donations {
proxy_pass http://127.0.0.1:8999;
proxy_pass http://127.0.0.1:9001;
# don't rate limit this API prefix
}
location /api/v1/donations/images {
proxy_pass http://127.0.0.1:8999;
proxy_pass http://127.0.0.1:9001;
proxy_cache cache;
proxy_cache_valid 200 1d;
}
@ -115,7 +126,7 @@
limit_req burst=50 nodelay zone=api;
}
location /api/ {
proxy_pass http://[::1]:3000/;
proxy_pass http://electrs-mainnet/;
limit_req burst=50 nodelay zone=electrs;
}
@ -131,7 +142,7 @@
limit_req burst=50 nodelay zone=api;
}
location /liquid/api/ {
proxy_pass http://[::1]:3001/;
proxy_pass http://electrs-liquid/;
limit_req burst=50 nodelay zone=electrs;
}
@ -147,7 +158,7 @@
limit_req burst=50 nodelay zone=api;
}
location /testnet/api/ {
proxy_pass http://[::1]:3002/;
proxy_pass http://electrs-testnet/;
limit_req burst=50 nodelay zone=electrs;
}
@ -171,6 +182,22 @@
limit_req burst=50 nodelay zone=api;
}
# signet API
location /signet/api/v1/ws {
proxy_pass http://127.0.0.1:8995/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /signet/api/v1 {
proxy_pass http://127.0.0.1:8995/api/v1;
limit_req burst=50 nodelay zone=api;
}
location /signet/api/ {
proxy_pass http://electrs-signet/;
limit_req burst=50 nodelay zone=electrs;
}
# mainnet API
location /ws {
proxy_pass http://127.0.0.1:8999/;

View File

@ -167,6 +167,17 @@ http {
}
}
upstream electrs-signet {
server [2401:b140:1::100:220]:3003;
}
server {
listen 127.0.0.1:2003;
access_log /dev/null;
location / {
proxy_pass http://electrs-signet;
}
}
server {
listen 80;
server_name mempool.space mempool.ninja node100.bitcoin.wiz.biz;