Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 ( 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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