63

当我使用ngrok& 运行 ngrok 给出的 url 时,配置如下:

  • 我的本地网址是:localhost:8080/someexample
  • 我的ngrok网址是:http://f07d0862.ngrok.io/

它显示此错误:

Bad Request - Invalid Hostname  HTTP Error 400. 
4

4 回答 4

176

您的 Web 服务器拒绝该请求,因为它具有不同的主机名。

尝试ngrok http -host-header="localhost:8080"

于 2015-12-09T15:37:33.023 回答
38

这是您想要的解决方案。

ngrok http 8080 -host-header="localhost:8080"
于 2019-08-08T10:18:03.213 回答
5

This worked for me:

ngrok http -host-header=localhost 8080
于 2021-01-19T16:22:49.157 回答
-2

可能是你应该关闭你的防火墙。

这对我行得通。

于 2018-03-26T05:15:47.873 回答