W
W
WhiteNinja2017-01-16 14:58:32
IIS
WhiteNinja, 2017-01-16 14:58:32

How to deny access to a file at the root of a web application on IIS8?

Good afternoon!
There is an ASP.NET MVC 5 web application deployed on a prod server, at the root of which, in addition to web.config, is config.json, which also stores certain settings for the application to work.
Unfortunately, if you go to somesite.ru/config.json , you can see all the contents of the config.
Question - How can I disable access to this file by http request?
Thanks in advance for any help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WhiteNinja, 2017-01-16
@WhiteNinja

Solved the problem like this:

<security>
 <system.webServer>
      <requestFiltering>
        <hiddenSegments>
          <add segment="config.json"/>
        </hiddenSegments>
      </requestFiltering>
    </security>
  </system.webServer>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question