From 7195d6ea3166a795d55cc74d2ae291167ff6ad35 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 21 Feb 2021 03:39:19 +0900 Subject: [PATCH] Update nginx.conf for signet, services, and disable SSR for now --- production/nginx-mempool.conf | 39 +++++++++++++++++++++++++++++------ production/nginx.conf | 11 ++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/production/nginx-mempool.conf b/production/nginx-mempool.conf index bd06fac65..cee3db369 100644 --- a/production/nginx-mempool.conf +++ b/production/nginx-mempool.conf @@ -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/; diff --git a/production/nginx.conf b/production/nginx.conf index 2c1230eee..a83dbc925 100644 --- a/production/nginx.conf +++ b/production/nginx.conf @@ -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;