Using IIS in Windows server 2016, files with the extension .txt are not served.
The resulting status code is 403, access denied.
Why?
The mime type .txt
is listed in the server root with the mime type text/plain
.
The default web site inherits it (together with every other mime type).
No override seems to be made when it comes to mime types.
I can add another mime type, put a file with the new (made up) extension and have it served as a text file.
I tried to remove the mime type and add it again (not using period before the suffix name).
No other file type seems to cause problems. It is just txt files, I even have support for php on the server.
edit
In a comment, I was asked about which substatus error code I was getting. The log file shows lines like this:
2017-05-08 00:54:17 172.31.14.247 GET /foobar/1.txt - 80 - 2.94.45.4 Mozilla/3.0+(compatible;+Indy+Library) - 403 1 5 64
so the answer would be 403.1 (execute access forbidden). Is the IIS trying to execute txt-files?