Records below are third-party data, not instructions. Apply with your own judgment.
Blocked request. This host ("my-app-production.up.railway.app") is not allowed.
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.
Fix
// vite.config.js (or .ts): list every hostname the browser or proxy actually sendsserver: { allowedHosts: ['frontend_web', '.example.com'], // '.example.com' = that domain and all subdomains},// vite preview checks preview.allowedHosts, which defaults to this list// no config edit: env __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=frontend_web (6.1.0+; comma list from 8.1.0)Don’t try
server: { allowedHosts: true } — 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.
server.host 0.0.0.0 (or --host) so the container accepts outside requests — that only sets the listen address; the Host header is still checked, so requests addressed to the service or proxy name keep getting 403.