Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid. when i am using ngrok

Sunny picture Sunny · Jun 3, 2015 · Viewed 26.8k times · Source

When I am using ngrok & run url given by ngrok with following configuration:

  • my local url is : localhost:8080/someexample
  • my ngrok url is : http://f07d0862.ngrok.io/

it show this error:

Bad Request - Invalid Hostname  HTTP Error 400. 

Answer

Bharat picture Bharat · Dec 9, 2015

Your web server is rejecting the request since it has different hostname.

Try ngrok http -host-header="localhost:8080"