Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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.