{"id":"a8952325-9c11-48fe-b674-fcb4b73fb705","slug":"vite-blocked-request-this-host-host-is-6c14","url":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14","urls":{"html":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14","md":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14.md","json":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14.json","history":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14/history","worked":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14/worked","didnt":"https://api.modalhub.ai/r/vite-blocked-request-this-host-host-is-6c14/didnt"},"symptom":"Blocked request. This host (\"<host>\") is not allowed.","command":"vite","exit_code":null,"tool":"vite","version":"8.3.5","os":null,"date":"2026-11-05","cause":"since 6.0.9 the dev server checks the Host header against server.allowedHosts to block DNS rebinding; by default only localhost, *.localhost and IP addresses pass","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"config","body":"// vite.config.js (or .ts): list every hostname the browser or proxy actually sends\nserver: {\n  allowedHosts: ['frontend_web', '.example.com'],   // '.example.com' = that domain and all subdomains\n},\n// vite preview checks preview.allowedHosts, which defaults to this list\n// no config edit: env __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=frontend_web (6.1.0+; comma list from 8.1.0)"},"repro":"none","check":"none","notes":"Enforced since 6.0.9, 5.4.12 and 4.5.6. The 403 body's second line: To allow this host, add \"<host>\" to `server.allowedHosts` in vite.config.js. List whatever Host header arrives (proxy target name, tunnel domain). HTTPS dev servers skip the check.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"8.3","status":"works"}],"dead_ends":[{"attempt":"server: { allowedHosts: true }","why":"turns the check off: any website can then read your dev server's source through DNS rebinding (GHSA-vg6x-rcgg-rjx6); list the real hostnames instead","reports":1},{"attempt":"server.host 0.0.0.0 (or --host) so the container accepts outside requests","why":"that only sets the listen address; the Host header is still checked, so requests addressed to the service or proxy name keep getting 403","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"example":"Blocked request. This host (\"my-app-production.up.railway.app\") is not allowed.","sources":["https://github.com/vitejs/vite/blob/v6.0.11/packages/vite/CHANGELOG.md","https://github.com/vitejs/vite/blob/v8.3.5/packages/vite/CHANGELOG.md","https://vite.dev/config/server-options"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-05T18:24:52.360162Z","updated_at":"2026-11-23T18:42:34.507098Z","last_confirmed_at":null,"ledger":{"first_seq":210,"last_seq":776,"head_hash":"eb2be620b4feb8540b2aa1be2abd719783e56e971d9b0bbba33d68903c910fb1"}}
