{
  "id": 13399607,
  "title": "Why Traccar's WebSocket needs a proxy, and how to set one up with nginx",
  "url": "https://urgent.news/2026/10/10/why-traccars-websocket-needs-a-proxy-and-how-to-set-one-up-with-nginx",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-10T11:48:57.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/telematicslab/why-traccars-websocket-needs-a-proxy-and-how-to-set-one-up-with-nginx-1in0"
  },
  "original_language": "en",
  "account": "Traccar's WebSocket requires a proxy due to two design choices in the software. Firstly, the WebSocket only accepts a session cookie for authentication, which cannot be added to a WebSocket connection in the browser. Secondly, Traccar does not send any CORS headers by default, causing cross-origin requests to be blocked by the browser. To solve these issues, set up a reverse proxy using nginx. This proxy serves the frontend files and forwards API requests to Traccar, allowing the browser to automatically send the session cookie and eliminating the need for CORS headers. Implementing this configuration involves updating the nginx configuration file with specific proxy settings and ensuring the frontend and Traccar services are accessible through the proxy.",
  "summary": "You have Traccar running, the REST API answers, and now you want a custom web map that moves vehicles live. You open a WebSocket to /api/socket , and it fails. Or it connects from Traccar's own UI but never from your page. This isn't a bug in your code. It comes from two design choices in Traccar, and once you see them, the fix is a short nginx config. The two problems 1. The WebSocket only…",
  "key_points": [
    "Traccar's WebSocket needs a proxy due to authentication and CORS issues.",
    "WebSocket only accepts session cookie for authentication, not possible in browser.",
    "Nginx proxy solves issues by forwarding API requests and serving frontend files."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}