Skip to content

Configure Vite proxy and Nginx for WebSocket traffic #8

@omattsson

Description

@omattsson

Summary

Update development proxy and production Nginx config to support WebSocket connections on the /ws path.

Tasks

  • Modify frontend/vite.config.ts:
    • Add proxy entry for /ws with target: 'http://backend:8081', ws: true, and appropriate headers
  • Modify frontend/nginx.conf:
    • Add location /ws block with:
      • proxy_pass http://backend:8081;
      • proxy_http_version 1.1;
      • proxy_set_header Upgrade $http_upgrade;
      • proxy_set_header Connection 'upgrade';
      • proxy_read_timeout 86400s; (prevent Nginx from closing idle WS connections)
  • Verify docker-compose.yml needs no port changes (WS runs on same port 8081)

Acceptance Criteria

  • WebSocket connects successfully through Vite dev proxy
  • WebSocket connects successfully through Nginx in Docker
  • No impact on existing REST API proxying

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions