Is there anyway I can configure Web.config to deny all access to an ASP .axd service other than from localhost?

link|improve this question

75% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Not in web.config, but if you navigate to the file/folder in IIS Manager that you want to protect, right-click it>Properties>File (or Directory) Security tab>Edit under "IP address and domain name restrictions", you can click "Denied access" and add the server's IP to the list of addresses (127.0.0.1 won't work since it will not be connecting FROM that IP to the website). That will block everybody except the local server. You also may want to add a custom error page for HTTP error 403.6 on that page if you want to obscure the reasons for the denial of the page from the client.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.