Hi,
I have a website that distributes to 5 different servers for load balance. Is there a way I can tell which of those servers I am hitting each time I load a page?
Thanks!
Hi,
I have a website that distributes to 5 different servers for load balance. Is there a way I can tell which of those servers I am hitting each time I load a page?
Thanks!
Easiest way is to have each server set a header saying which node it is.
Thanks. How would I do this? Could I just insert some code on my page and display it as a comment so I can view the server IP by viewing the source?
It depends on which web server you are using. Using Apache, if mod_headers is enabled you can use Header add or set (depending on version of Apache) to create a custom header.
Header set ServerNumber "Server 3"
http://httpd.apache.org/docs/2.4/mod/mod_headers.html
Each server would have one little entry in a config file to send a custom header specific to that server. Then you can view the header in a browser’s web developer tools like those that ship with Firefox or Google Chrome.
Yup – really depends on where is easiest to deal with for you, the server header in the config is a good default choice though.
I’ll note there is one security downside here – if there is some reason an attacker wanted a particular server you are letting the world know which server is which.