使用 IIS 随机 404

发布于 2024-12-05 00:44:35 字数 250 浏览 0 评论 0原文

什么会导致 IIS 仅有时返回 404?如果我在页面上遇到 404,我只需点击刷新,它就会出现。它是可重现的。我用 fiddler 来查看发生了什么,但没有看到任何异常。我已经设置了 IIS 跟踪,但同样,我不知道问题到底是什么,该文件存在,并且 404 仅有时会出现。有时我的意思是,如果我导航到某个页面并收到 404 错误,我可以刷新并且它会出现,但其他时候我可以导航到该页面,但它不会出现 404。它不限于任何一页或条件。

我还可以尝试哪些其他方法来确定问题所在?

What would cause IIS to return a 404, only sometimes? If I hit a 404 on a page, I can simply hit refresh and it will come up. It's reproducible. I've used fiddler to see what's going on and I don't see anything off. I've setup IIS tracing but again, I don't see what exactly the issue would be, the file exists and the 404 only occurs sometimes. By sometimes I mean if I navigated to a page and got a 404 I could refresh and it would come up but other times I could navigate to that page and it would not 404. It isn't limited to any one page or condition.

What other things can I try to determine what the issue is?

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

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

发布评论

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

评论(4

如果您运行 Fiddler 并且看到请求到达服务器并且看到 404,那么这听起来不像是网络场问题。

您可能想尝试 SysInternals ProcMon 看看下面发生了什么。

If you've run Fiddler and you see the request arrive at the server and you see a 404, then this doesn't sound like a web farm problem.

You might want to try SysInternals ProcMon to see what's going on underneath.

仄言 2024-12-12 00:44:35

出现这种情况的通常原因是您有一个包含多台计算机的网络场,其中一台计算机上的页面丢失了。

因此,每次随机使用缺少页面的机器时,您都会收到 404 错误。

The usual reason for this is that you have a web farm with several machines, on one machine the pages are missing.

Therefore, each time you randomly use the machine with the missing pages you get a 404.

晌融 2024-12-12 00:44:35

我遇到过类似的问题,我追溯到将其更改

<modules runAllManagedModulesForAllRequests="true" />

为:

<modules runAllManagedModulesForAllRequests="false" />

显然,需要进行分析以确保这不会以任何其他方式影响您的应用程序。

I've had this similar issue and I traced it back to changing this:

<modules runAllManagedModulesForAllRequests="true" />

to:

<modules runAllManagedModulesForAllRequests="false" />

Obviously, analysis will need to be done to make sure that this doesn't affect your application in any other way.

十年九夏 2024-12-12 00:44:35

我只在 MVC 应用程序中使用此选项,因为在某些情况下我的路线不正确。单击将产生 404,但 F5(刷新)将正确显示网页。你没有提到 mvc 但认为值得把它放进去。

I have only has this when an MVC application because for certain situations my routes were not correct. Clicking would produce the 404 but F5(refresh) would show the webpage correctly. You don't mention mvc but thought it worth throwing this in.

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