使用 IIS 随机 404
什么会导致 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.
出现这种情况的通常原因是您有一个包含多台计算机的网络场,其中一台计算机上的页面丢失了。
因此,每次随机使用缺少页面的机器时,您都会收到 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.
我遇到过类似的问题,我追溯到将其更改
为:
显然,需要进行分析以确保这不会以任何其他方式影响您的应用程序。
I've had this similar issue and I traced it back to changing this:
to:
Obviously, analysis will need to be done to make sure that this doesn't affect your application in any other way.
我只在 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.