How to identify which web server in a farm served a request?

后端 未结 1 1031
情深已故
情深已故 2021-01-14 18:25

We\'re debugging intermittent issues with a website running on IIS7.

Since we have many nodes behind the load balancer, we can\'t tell which host responded to a give

1条回答
  •  再見小時候
    2021-01-14 18:55

    Without writing any code you could just configure a custom HTTP Response Header for each machine in IIS Manager. You'd need to manually enter each IP address or identifier manually using either the GUI or APPCMD.EXE. This can be done globally for all sites:

    appcmd.exe set config -section:system.webServer/httpProtocol 
                  /+"customHeaders.[name='X-Custom-Name',value='MyCustomValue']"
    

    Or for a single site:

    appcmd.exe set config "Default Web Site" -section:system.webServer/httpProtocol 
                  /+"customHeaders.[name='X-Custom-Name',value='MyCustomValue']"
    

    I've split these commands over two lines just to fit them in. You should enter them as a single line.

    0 讨论(0)
提交回复
热议问题