2026-02-03 21:43:33 +00:00
|
|
|
server {
|
|
|
|
|
listen 8334;
|
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
# Bitcoin RPC proxy to avoid CORS issues
|
|
|
|
|
location /bitcoin-rpc/ {
|
|
|
|
|
# Proxy to localhost Bitcoin RPC (using host network mode)
|
|
|
|
|
proxy_pass http://127.0.0.1:8332/;
|
|
|
|
|
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;
|
2026-03-18 15:31:17 +00:00
|
|
|
proxy_set_header Authorization "Basic __BITCOIN_RPC_AUTH__";
|
2026-02-03 21:43:33 +00:00
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
|
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
|
|
|
|
|
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
|
|
|
|
|
if ($request_method = OPTIONS) {
|
|
|
|
|
return 204;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
}
|