How to allow customs hosts in development mode

That always ends up in

502 Bad Gateway
The server returned an invalid or incomplete response.