ngrok“ http错误404”。找不到所请求的资源

发布于 2025-02-03 16:49:57 字数 220 浏览 4 评论 0原文

错误图片

我试图用“ ngrok”执行我的django-app。将URL添加到“允许的host”和其他需要的变量中。我做了“ py manage.py runserver”和“ ngrok http 80” =>没有结果。

Error picture

I've tried to execute my django-app with "ngrok". Added url to "ALLOWED_HOSTS" and other variables which need that. I did 'py manage.py runserver' and 'ngrok http 80' together => no result.

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

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

发布评论

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

评论(2

清旖 2025-02-10 16:49:57

几个小时后,我发现您必须从CMD而不是从IDE终端运行NGrok。

PS如果您在“ C:\ Windows \ System32 \ eetc \ etc \ hosts ”中为您的本地地址设置域,则该命令可能会帮助您:

ngrok http -host-header =重写 mysite.com:80

其中 mysite.com - 您的域名,:80 < /strong> - 您的端口。

A few hours later, I figure out that you must run your ngrok from CMD, not from IDE Terminal.

P.S. If you set domain in 'C:\Windows\System32\Drivers\etc\ hosts' for your local address, that command help may help you:

ngrok http --host-header=rewrite mysite.com:80

where mysite.com - your domain name, :80 - your port.

玻璃人 2025-02-10 16:49:57

我试图通过Ngrok将Stripe Webhooks连接到我的Localhost,但是传入的请求是看到404 s(很奇怪,因为这些 s noted the at the App Api Api中没有任何变化) 。

Ngrok也没有提供任何错误消息,也没有像通常那样在终端中显示请求(我可以从Stripe仪表板上看到404)。

解决方案:我将Ngrok升级到了最新版本(brew升级ngrok),启动了一个新的终端,并以通常的方式启动了Ngrok,问题已经消失。

I was trying to have Stripe webhooks connect to my localhost via ngrok, but the incoming requests were seeing 404s (weird, because these had worked in the past and nothing in the app nor stripe api had changed).

Ngrok didn't give any error message either, and it wasn't displaying the requests in the terminal as it usually would (I could see the 404 from the Stripe dashboard).

Solution: I upgraded ngrok to the most recent version (brew upgrade ngrok), started a new terminal and started ngrok in the usual way, and the problem was gone.

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