NGrok无效主机标头

发布于 2025-02-04 03:26:03 字数 456 浏览 3 评论 0原文

我正在使用Ngrok揭露我的React应用程序。由于“无效的主机标头”,我使用ngrok http 3000 -host-header =“ localhost:3000”重新编写了主机标头,效果很好。

我遇到的问题是,当我在后端node.js服务器中添加时,我在ngrok..yml文件中添加了多个隧道:

    tunnels:
  first:
    addr: 3000
    proto: http    
  second:
    addr: 5000
    proto: http

现在,揭露react& Node.js,我正在使用

ngrok start --all

,但是现在我回到了一个问题,即我的前端将无效的主机标头获得。如何使用“ Ngrok Start -All”重写前端的主机标头?

I am using ngrok to expose my react app. Due to an "invalid host header", I have re-written the host header using ngrok http 3000 -host-header="localhost:3000", which works fine.

The problem that I am encountering is that when I added in my backend node.js server, I added multiple tunnels to my ngrok.yml file :

    tunnels:
  first:
    addr: 3000
    proto: http    
  second:
    addr: 5000
    proto: http

Now, to expose react & node.js, I am using

ngrok start --all

But now I am back to the issue where I am getting the invalid host header on my front end. How do I rewrite my host header for my front end with the "ngrok start --all"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放手` 2025-02-11 03:26:03

我已经为遇到类似情况的其他人设法解决了这个问题。

在ngrok.yml文件中,包括host_header:“ localhost:3000”

I have managed to solve this issue for others who do encounter a similar situation.

In the ngrok.yml file, include host_header: "localhost:3000"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文