Question

I have 2 IIS7 servers working in NLB cluster, and replicated by DFSR service. It works.

On each one I have ASP.NET application. It has its web.config file. This file is replicated, so it's identical on both servers. There is however one directory which is not replicated. This is my special directory where I put data for AJAX scripts. The files inside are constantly updated.

Then I've tried to enable CORS with web.config file put inside my special AJAX directory.

It works on first server, doesn't work on the second one. On the second one I get error 500 when I try to access any file in AJAX directory.

I've double checked that the errors occur with ANY web.config content. If a web.config file is present in this directory, web server refuses to serve files from there. The problem is NOT related to web.config content. I created the file manualy, and with IIS Manager. No matter what I set, if the file is present, I get 500, period.

There is no such problem on my first server. It accepts all valid configurations in web.config.

Both servers use exactly the same configuration. They are (or at least should be) clones.

I've checked system logs - no trace of those 500s. What happens? What could be broken or misconfigured, if IIS7 doesn't accept any web.config file in application subdirectory?

Was it helpful?

Solution

When you want to use second web.config in a subdirectory, you just need to convert this or containing subdirectory to application in IIS Manager. That's all. Works as charm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top