Files
nginx/sites-available/api-explore.hanzo.network
zeekay 8798c5c499 Add comprehensive nginx configurations for all services
- Add explorer frontend configs for all networks (explore.*.network)
- Add explorer API configs for all networks (api-explore.*.network)
- Add Graph Protocol configs (graph.lux.network, graph.zoo.network)
- Add IPFS gateway configs (ipfs.lux.network, ipfs.zoo.network)
- Add stats service configs for all networks
- Add visualizer configs for all networks
- Add signature provider configs for all networks
- Fix port mappings to match running Docker containers
- Update stats.lux.network to use correct port (8050 instead of 8053)
- Update viz.lux.network to use correct port (8052 instead of 8050)
- Add TODO comment for Hanzo blockchain ID (network not deployed yet)
- Enable CORS headers on all API endpoints
- Configure WebSocket support where needed
- Set appropriate timeouts for different service types
2025-07-30 20:32:45 +00:00

42 lines
1.5 KiB
SYSTEMD

# Hanzo Network Explorer API
server {
listen 8080;
listen [::]:8080;
server_name api-explore.hanzo.network;
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
add_header 'Access-Control-Allow-Headers' '*' always;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
# CORS headers for regular requests
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
add_header 'Access-Control-Allow-Headers' '*' always;
proxy_pass http://127.0.0.1:4003;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
# WebSocket support
proxy_set_header Connection $http_connection;
proxy_buffering off;
# Timeout settings
proxy_read_timeout 86400;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
}
}