NGrok无效主机标头
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经为遇到类似情况的其他人设法解决了这个问题。
在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"