Skip to content

[BUG] rustchain.org /api/stats returns Nginx 404 because proxy config omits route #7076

@pqmfei

Description

@pqmfei

Summary

https://rustchain.org/api/stats is documented and implemented in the Flask node, but the live rustchain.org Nginx config does not proxy that route. The public site returns a plain Nginx 404 before the request reaches the node.

Live reproduction

curl -sk -w "\nHTTP:%{http_code}\n" https://rustchain.org/api/stats

Actual response:

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
HTTP:404

Neighboring public routes are reachable through the same domain:

curl -sk https://rustchain.org/health
curl -sk https://rustchain.org/epoch
curl -sk https://rustchain.org/api/miners?limit=3

Expected behavior

GET /api/stats should be proxied to the node and return the backend JSON payload including chain_id, epoch, total_miners, total_balance, and related network statistics.

Impact

  • The documented public stats endpoint is unusable on the live domain.
  • React Native wallet clients use /api/stats to fetch chain_id before signing transfers, so mobile sends can fail before submitting /wallet/transfer/signed.
  • Monitoring and cross-node validation tooling that compares /api/stats cannot run against https://rustchain.org.

Root cause

site/nginx-rustchain-org.conf explicitly proxies routes such as /health, /epoch, /api/status, /api/miners, and /wallet/, but omits /api/stats in both the testing and production server blocks.

Proposed fix

Add /api/stats proxy locations in both rustchain.org Nginx server blocks and cover the deployment config with a regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions