mempool/production/nginx/server-bisq.conf

84 lines
2.2 KiB
Plaintext

include mempool/production/nginx/server-common.conf;
include mempool/production/nginx/location-api-v1-services.conf;
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 {
proxy_pass http://mempool-bitcoin-bisq/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location @mempool-bisq {
proxy_pass http://mempool-bitcoin-bisq;
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;
}