Replit Preview / Dev URL returns HTTP 502, but localhost works

Hello. I imported a GitHub project into Replit. The app is a Vite React project.

The app works internally:

curl -I http://localhost:8080/dashboard

returns:

HTTP/1.1 200 OK
Content-Type: text/html

But the external Replit dev URL fails:

curl -I https://$REPLIT_DEV_DOMAIN/dashboard

returns:

HTTP/2 502

The app is started with:

PORT=8080 BASE_PATH=/ __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=$REPLIT_DEV_DOMAIN pnpm run dev

Vite shows:

Local: http://localhost:8080/
Network: http://172.24.0.2:8080/

So the app is running inside the workspace, but the external Preview/dev URL is not routing correctly.

Is this a Replit proxy/Preview issue, or is there another setting required for imported Vite projects?

Additional note: I did not attach screenshots, but the outputs above were copied directly from the Replit Shell. The internal localhost request returns 200 OK, while the external Replit dev URL returns 502.