Merge branch 'master' into simon/angular-universal

* master:
  Enable nginx reverse proxy cache for sponsor profile images + misc tweaks
  Update Bisq price API: markets.bisq.network -> bisq.markets
This commit is contained in:
softsimon 2020-11-07 14:03:03 +07:00
commit b39d12f64e
2 changed files with 19 additions and 4 deletions

View File

@ -138,7 +138,7 @@ class Bisq {
}
private updatePrice() {
request('https://markets.bisq.network/api/trades/?market=bsq_btc', { json: true }, (err, res, trades: BisqTrade[]) => {
request('https://bisq.markets/api/trades/?market=bsq_btc', { json: true }, (err, res, trades: BisqTrade[]) => {
if (err || !Array.isArray(trades)) { return logger.err('Error updating Bisq market price: ' + err); }
const prices: number[] = [];

View File

@ -54,6 +54,9 @@ http {
# limit request body size
client_max_body_size 10m;
# proxy cache
proxy_cache_path /var/cache/nginx keys_zone=cache:20m levels=1:2 inactive=600s max_size=500m;
# rate limit requests
limit_req_zone $binary_remote_addr zone=api:5m rate=50r/m;
limit_req_zone $binary_remote_addr zone=electrs:5m rate=1000r/m;
@ -104,6 +107,7 @@ http {
add_header Content-Security-Policy $contentSecurityPolicy;
add_header Link "<https://mempool.space$request_uri>; rel=\"canonical\"";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
#add_header Onion-Location http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion$request_uri;
# /
@ -111,6 +115,16 @@ http {
try_files $uri $uri/ /index.html =404;
}
# # /sitemap
# location /sitemap {
# try_files $uri =410;
# }
#
# # /explorer
# location /explorer {
# rewrite /explorer/(.*) https://$host/$1 permanent;
# }
# /api
location = /api {
@ -120,8 +134,10 @@ http {
try_files $uri $uri/ /index.html =404;
}
location /api/v1/donations {
proxy_pass http://127.0.0.1:8999;
# don't rate limit this URL prefix
proxy_pass http://127.0.0.1:8999;
proxy_cache cache;
proxy_cache_valid 200 1d;
}
location /api/v1/ws {
proxy_pass http://127.0.0.1:8999/;
@ -224,7 +240,6 @@ http {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
limit_conn websocket 10;
}
location /bisq/api/v1/markets {
proxy_pass http://127.0.0.1:8996/api/v1/bisq/markets;
@ -236,7 +251,7 @@ http {
}
location /bisq/api {
proxy_pass http://127.0.0.1:8996/api/v1/bisq;
limit_req burst=100 nodelay zone=electrs;
limit_req burst=50 nodelay zone=api;
}
}
}