Preview URLs return a 502 server error
This error occurs when the server running inside the sandbox is binding tolocalhost. As a result, it is only reachable inside the sandbox; the external preview URL will not be able to access it.
To resolve this error, configure your server to bind to IP address 0.0.0.0, so that it listens on all available network interfaces. To avoid IPv4/IPv6 compatibility issues, we recommend using the environment variable BL_SERVER_HOST instead of setting the address to a static value.
For example, in code:
Deployment fails with STARTUP TCP probe failed or DEADLINE_EXCEEDED error
This error occurs when the server running inside the sandbox is not binding to the correct host and port.
To resolve this error, configure your server to bind to the host and port designated by the BL_SERVER_HOST and BL_SERVER_PORT environment variables. Blaxel automatically injects these variables during deployment.
For example:
