Skip to content

Commit 70d6d0a

Browse files
JOYclaude
andcommitted
fix: route stats API through path-based proxy on mainnet
- Add /stats-api/ handler in Caddy mainnet config (strips prefix, CORS) - Update STATS_API_HOST from stats.doscan.io to doscan.io/stats-api (stats.doscan.io blocked by Cloudflare WAF 403) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a16c70f commit 70d6d0a

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

docker-compose/Caddyfile-mainnet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ doscan.io, www.doscan.io {
2626
reverse_proxy backend:4000
2727
}
2828

29+
# Stats API (path-based, avoids Cloudflare subdomain issues)
30+
handle /stats-api/* {
31+
uri strip_prefix /stats-api
32+
header Access-Control-Allow-Origin "https://doscan.io"
33+
header Access-Control-Allow-Methods "GET, OPTIONS"
34+
header Access-Control-Allow-Headers "Content-Type"
35+
reverse_proxy stats:8050
36+
}
37+
2938
# Visualizer API (path-based)
3039
handle /visualize/* {
3140
reverse_proxy visualizer:8050

docker-compose/envs/common-frontend.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ NEXT_PUBLIC_HAS_USER_OPS=true
197197
# =============================================================================
198198
# FEATURE: STATS SERVICE
199199
# =============================================================================
200-
NEXT_PUBLIC_STATS_API_HOST=https://stats.doscan.io
200+
NEXT_PUBLIC_STATS_API_HOST=https://doscan.io/stats-api
201201

202202
# =============================================================================
203203
# FEATURE: VISUALIZE API

0 commit comments

Comments
 (0)