2022-01-04 07:28:17 +01:00
|
|
|
include mempool/production/nginx/server-common.conf;
|
2022-01-14 12:38:10 +01:00
|
|
|
include mempool/production/nginx/location-api-v1-services.conf;
|
2022-01-04 07:28:17 +01:00
|
|
|
|
|
|
|
proxy_cache markets;
|
|
|
|
proxy_cache_valid 200 30s;
|
|
|
|
|
|
|
|
# route electrs APIs to electrs
|
|
|
|
location /api/tx/ {
|
|
|
|
proxy_pass http://electrs-bitcoin-mainnet/tx/;
|
|
|
|
}
|
|
|
|
|
|
|
|
# rewrite APIs to match what backend expects
|
|
|
|
location /api/currencies {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/depth {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/hloc {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/offers {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/ticker {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/trades {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/volumes {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/markets {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/markets/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api/v1 {
|
|
|
|
rewrite ^/api/v1/(.*) /api/v1/bisq/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /api {
|
|
|
|
rewrite ^/api/(.*) /api/v1/bisq/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /bisq/api/v1 {
|
|
|
|
rewrite ^/bisq/api/v1/(.*) /api/v1/bisq/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
location /bisq/api {
|
|
|
|
rewrite ^/bisq/api/(.*) /api/v1/bisq/$1 break;
|
|
|
|
try_files $uri $uri/ @mempool-bisq;
|
|
|
|
}
|
|
|
|
|
|
|
|
# special handling for websocket
|
|
|
|
location /api/v1/ws {
|
2022-01-05 10:12:05 +01:00
|
|
|
proxy_pass http://mempool-bitcoin-bisq/;
|
2022-01-04 07:28:17 +01:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
}
|
|
|
|
|
|
|
|
location @mempool-bisq {
|
2022-01-05 10:12:05 +01:00
|
|
|
proxy_pass http://mempool-bitcoin-bisq;
|
2022-01-04 07:28:17 +01:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
|
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
}
|