Random 404 using IIS

北城以北 提交于 2019-12-13 00:21:54

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/7438250/random-404-using-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!