mirror of
https://github.com/luxfi/nginx.git
synced 2026-11-16 21:26:33 +00:00
- 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
34 lines
1.5 KiB
SYSTEMD
34 lines
1.5 KiB
SYSTEMD
server {
|
|
listen 8080;
|
|
listen [::]:8080;
|
|
server_name api.hanzo.network;
|
|
|
|
location / {
|
|
# Add CORS headers
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
|
|
# Handle preflight requests
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
|
add_header 'Content-Length' 0;
|
|
return 204;
|
|
}
|
|
|
|
# Hanzo blockchain ID will be assigned when deployed
|
|
# TODO: Replace HANZO_BLOCKCHAIN_ID with actual blockchain ID once deployed
|
|
# Chain ID: Mainnet 36963, Testnet 36962
|
|
proxy_pass http://localhost:9630/ext/bc/HANZO_BLOCKCHAIN_ID/rpc;
|
|
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;
|
|
}
|
|
} |