I tried to serve a proxy.pac file from the IIS on my localhost (IIS 7.5/Windows 7), to test some changes to a proxy auto-configuration script. IIS gave me a 404 error instead of serving the file. After fiddling about with various security settings for quite some time, I was eventually able to figure out the problem. If IIS lacks a configured MIME type for a file then it will refuse to serve it — returning a 404 error instead. I suspected MIME types could have something to do with it after I found out that IIS happily served the file as a regular text file if the file was named proxy.txt. As always with Microsoft, when you've successfully pinpointed the problem yourself, you're finally able to launch a Google search that reveals something useful...
Turns out it's all documented, e.g. in the article with the catchy title: Error message when users visit a Web site that is hosted on a server that is running Internet Information Services 7.0: "HTTP Error 404.3 - Not Found". Note, Microsoft states that users visiting the web site will get an error message indicating that the problem is caused by the missing MIME map policy. For the record, I've tested multiple browsers, IE9, FF4,Chrome, Opera. Neither showed a useful error page, so IIS 7.5 does not serve such a page by default.
So, the file exists and you get the generic 404. How can you verify the problem? If you look in the IIS log file you'll see something similar to this (I've truncated the user agent):
GET /proxyx.pac - 8000 - ::1 Mozilla/5.0+(compatible;+MSIE+9.0;.....) 404 3 50 1Note the status codes: 404 3. These are the clues Microsoft has left for you on your quest to serve a static file from IIS. That's unless you, like me, find that you do not have any log files. In that case you should check out my latest post: Enabling IIS log files on Windows 7.
Fortunately, the problem is easily fixed. To add a MIME type for the proxy.pac go to the IIS Manager and select the website. On the settings screen, you'll see the "MIME Types" in the IIS section. There you can "Add.." new MIME types.
That's it. IIS should now serve the file, with the correct MIME-type.