This is driving me bananas.

We have multiple REST servers. We set a custom header in IIS so we can identify which server is responding to a request. Each server passes its name in this header.

On the IIS 6 servers, this works %100. On IIS7, it works great... but after a few hrs or days, my custom header setting in IIS disappears.

I have custom bindings, and ssl, and all kinds of good stuff configured.

What could cause IIS to drop my custom header setting?

System is:

  • Win2008
  • IIS 7.0
  • Header name: X-APPSERVER-NAME
  • Using the inet manager gui application to make the change
    Just adding the header with the default value for local or server based setting

The sequence of events is:

  1. Go into IIS manager
  2. Go to your web site
  3. Add a custom header
  4. Test from fiddler, the new custom header is visible in the response
  5. Exit IIS Mgr,
  6. log out of windows
  7. Go home
  8. Go to bed
  9. Wake up
  10. Eat breakfast
  11. Go to work
  12. Discover the custom header is gone!
  13. Repeat Steps 1-12 a few times
  14. Post the issue here on server fault


  • IIS 7.0 or 7.5 (Win 2008 or 2008R2)? What is the header name? Do you use the inetmgr console or do you edit the config files directly? Have you added the header on a single web site, or on server-level (local or inherited)? Jul 15, 2012 at 10:49
  • Added detail to the OP Jul 15, 2012 at 15:10
  • Is there a proxy or load balancer sitting in front of this server?
    – Kev
    Jul 15, 2012 at 22:23
  • @Kev Yes, there is. But that would affect what I see in the response... not make changes to the iis config itself! Jul 16, 2012 at 1:46
  • Are you saying the header is being physically deleted from IIS config? i.e. you have to keep going in to IIS Manager (or use appcmd.exe or some such config script) to put it back?
    – Kev
    Jul 16, 2012 at 1:49

1 Answer 1


By default, this gets written in your web.config file when adding a header with default values (local) in IIS7:

<?xml version="1.0" encoding="UTF-8"?>
                <add name="X-Test" value="Test" />

I believe IIS6 does it differently.

Do you have some kind of auto-deploy/auto-update of your website, which would overwrite such a changed web.config? (And thus deletes the custom header?)

Then either change your source web.config, or add the header on IIS Level (Root node) which is not written to the applications web.config

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .