events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; server { listen 7860; server_name localhost; # Frontend estático (React / Vite) location / { root /var/www/html; try_files $uri $uri/ /index.html; } # API CRM (Rails) location /api/v1/ { proxy_pass http://127.0.0.1:3000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # Service Auth (Rails/Node) location /auth/ { proxy_pass http://127.0.0.1:3001/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # Procesador IA (FastAPI / Python) location /processor/ { proxy_pass http://127.0.0.1:8000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # WebSockets (Rails ActionCable) location /cable { proxy_pass http://127.0.0.1:3000/cable; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } } }