TASK_PHASE_NODE1_REPAIR: - Fix daarion-web SSR: use CITY_API_BASE_URL instead of 127.0.0.1 - Fix auth API routes: use AUTH_API_URL env var - Add wget to Dockerfiles for healthchecks (stt, ocr, web-search, swapper, vector-db, rag) - Update healthchecks to use wget instead of curl - Fix vector-db-service: update torch==2.4.0, sentence-transformers==2.6.1 - Fix rag-service: correct haystack imports for v2.x - Fix telegram-gateway: remove msg.ack() for non-JetStream NATS - Add /health endpoint to nginx mvp-routes.conf - Add room_role, is_public, sort_order columns to city_rooms migration - Add TASK_PHASE_NODE1_REPAIR.md and DEPLOY_NODE1_REPAIR.md docs Previous tasks included: - TASK 039-044: Orchestrator rooms, Matrix chat cleanup, CrewAI integration
137 lines
4.8 KiB
Plaintext
137 lines
4.8 KiB
Plaintext
# ============================================================================
|
|
# DAARION MVP Routes — Phase 1-3
|
|
# Add these routes to your Nginx config on NODE1
|
|
# ============================================================================
|
|
|
|
# Location: /etc/nginx/sites-available/daarion (or your main nginx config)
|
|
# After adding, run: sudo nginx -t && sudo systemctl reload nginx
|
|
|
|
# ============================================================================
|
|
# City Service (7001)
|
|
# ============================================================================
|
|
|
|
location /api/city/ {
|
|
proxy_pass http://127.0.0.1:7001/;
|
|
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;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
|
|
# CORS headers (if needed)
|
|
add_header Access-Control-Allow-Origin * always;
|
|
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always;
|
|
add_header Access-Control-Allow-Headers "Authorization, Content-Type" always;
|
|
}
|
|
|
|
# City WebSocket (for Living Map)
|
|
location /ws/city/ {
|
|
proxy_pass http://127.0.0.1:7001/ws/city/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
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;
|
|
proxy_read_timeout 86400; # 24 hours
|
|
proxy_send_timeout 86400;
|
|
}
|
|
|
|
# ============================================================================
|
|
# Second Me Service (7003)
|
|
# ============================================================================
|
|
|
|
location /api/secondme/ {
|
|
proxy_pass http://127.0.0.1:7003/;
|
|
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;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
|
|
# Increase timeout for AI responses
|
|
proxy_read_timeout 60s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
|
|
# ============================================================================
|
|
# Agents Service (7014)
|
|
# ============================================================================
|
|
|
|
location /api/agents/ {
|
|
proxy_pass http://127.0.0.1:7014/;
|
|
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;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
|
|
# Increase timeout for agent invocations
|
|
proxy_read_timeout 120s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
|
|
# Agents WebSocket (for events)
|
|
location /ws/agents/ {
|
|
proxy_pass http://127.0.0.1:7014/ws/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
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;
|
|
proxy_read_timeout 86400;
|
|
proxy_send_timeout 86400;
|
|
}
|
|
|
|
# ============================================================================
|
|
# MicroDAO Service (7015)
|
|
# ============================================================================
|
|
|
|
location /api/microdao/ {
|
|
proxy_pass http://127.0.0.1:7015/;
|
|
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;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
}
|
|
|
|
# ============================================================================
|
|
# Health Checks (for monitoring)
|
|
# ============================================================================
|
|
|
|
# Main /health endpoint (for external monitoring)
|
|
location = /health {
|
|
access_log off;
|
|
return 200 '{"status":"ok","service":"gateway.daarion.city"}';
|
|
add_header Content-Type application/json;
|
|
}
|
|
|
|
location /health/mvp {
|
|
access_log off;
|
|
return 200 "MVP services healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
|
|
# ============================================================================
|
|
# Rate Limiting (optional but recommended)
|
|
# ============================================================================
|
|
|
|
# Add to http block (not location):
|
|
# limit_req_zone $binary_remote_addr zone=mvp_api:10m rate=10r/s;
|
|
#
|
|
# Then in each location:
|
|
# limit_req zone=mvp_api burst=20 nodelay;
|
|
|
|
# ============================================================================
|
|
# END OF MVP ROUTES
|
|
# ============================================================================
|
|
|