2

I am running a web farm using shared config and would like to add something to every response to identify which node in the farm it has come from.

I was of the understanding that the inheritance of IIS configurations would mean that I could add my section in the machine.config files since they are unique to each node in the farm and it would cascade down.

   <system.webServer>
     <httpProtocol>
       <customHeaders>
         <add name="X-Machine-Name" value="SERVER1" />
       </customHeaders>
     </httpProtocol>
   </system.webServer>

I also removed the <clear /> out of the applicationHost.config customHeaders section but my custom X-Machine-Name does not appear on responses served by machines in my farm.

I would like to identify which machine the content is coming from, it doesn't need to be anything identifying to the machine, a simple 1,2,3 or a,b,c would do to keep it secure. I want to make it fairly easy if a colleague has to add a new node to the farm to be able to reproduce.

Matt
  • 1,436
  • 12
  • 24
  • This is IIS 8.5 by the way. – Matt Oct 29 '15 at 16:56
  • 1
    IIS settings in machine.config are simply ignored as IIS does not look for such there by design. – Lex Li Oct 29 '15 at 18:54
  • That is a disappointment. These two pages at the bottom seemed to imply that the httpProtocol and customHeaders sections could be added to machine.config https://msdn.microsoft.com/en-us/library/ms691407(v=vs.90).aspx https://msdn.microsoft.com/en-us/library/ms690556(v=vs.90).aspx – Matt Oct 30 '15 at 09:36
  • @Matt did you ever figure a way to do this? – eidylon May 03 '22 at 18:48
  • @eidlyon No sorry, our web farm never really got off the ground as I was the only one in the team who knew how it worked and how to develop applications to be more farm aware. A single IIS server has been so rock solid that we never really needed a farm. – Matt May 04 '22 at 09:23

0 Answers0