BIT-31 Expose Bitcoin Pulse API through nginx

This commit is contained in:
Tobserver Agent 2026-07-28 17:12:28 +07:00
parent 2015aac8e4
commit 133384660e
2 changed files with 95 additions and 0 deletions

View file

@ -265,5 +265,37 @@ in
};
};
services.nginx = {
appendHttpConfig = ''
limit_req_zone $binary_remote_addr zone=bitcoin_pulse_api:10m rate=300r/m;
'';
virtualHosts."bitcoin-pulse.tobiasostner.de" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
extraConfig = ''
limit_req zone=bitcoin_pulse_api burst=50 nodelay;
limit_req_status 429;
client_max_body_size 16k;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
proxy_connect_timeout 2s;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
proxy_next_upstream off;
'';
};
};
};
environment.systemPackages = [ pkgs.postgresql_18 ];
}