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

For debugging purposes, we would like to configure our pool of load balanced web servers to output an HTTP header identifying the "true" server which served the request. However, we don't know what header name this should be! Is there any pre-existing header for this? Do you have a favorite?

share|improve this question
add comment

1 Answer

AFAIK there isn't a formal standard for this. What I've seen is:

  • A custom HTTP header. It's really your choice as long as you stay in the X- namespace. For me personally X-Backend-Server is descriptive, and it seems popular.

  • Writing the backend server ID into an HTML comment at the end of the content body.

Update: I found this survey of HTTP headers in the wild from 2011. My suggestion X-Backend-Server is number 119, while X-Server-Name is number 56 on the list. So I'd say X-Server-Name seems the most common header for this.

share|improve this answer
    
Note that the X- prefix was deprecated: tools.ietf.org/html/rfc6648 –  Edward Z. Yang Jul 28 '12 at 21:10
    
@Edward Z. Yang: Good comment. From that RFC, section 1, bullet 4: "Makes no recommendation as to whether existing "X-" parameters ought to remain in use or be migrated [...]". Absent any newer implementations (that I don't know of) I would personally stick with X-Backend-Server or a similar "X-" header. :-) –  Jesper Mortensen Jul 28 '12 at 21:18
2  
The real point is that regardless of whether the "X-" headers are official, deprecated or anything else, they won't break anything and are very useful for purposes such as the one being asked about here. In short, it's perfectly fine to use them. –  John Gardeniers Jul 29 '12 at 0:15
1  
It looks like X-Served-By is actually used more as of today, according to that report. –  Brian Wigginton Oct 25 '12 at 17:38
add comment

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.