I have a cluster of Apache webservers using round-robin for primitive load balancing. Is there a way to have firefox or chrome request that server name from a specific IP?

If you just enter the , it doesn't get the ServerName, and if you enter http://servername, you could get any of the servers.

  • Is the round-robin a sticky session type of connection to the back end server? – djangofan May 18 '11 at 19:29
  • 2
    Dmourati and Eduardo's answers are both spot-on. – Hyppy May 18 '11 at 19:40
  • @djangofan : No--the servers are setup fully parallel with respect to session. If one drops off, any other server can resume the transaction. – Bryan Agee May 18 '11 at 20:35

I assume you mean DNS round-robin. In that case the basic way I can think of is to just edit your /etc/hosts to point to whatever backend you want to try in a particular moment: servername

You may have to restart your browser afterwards to make sure it isn't used a cached DNS answer.

Also you could add additional entries in your DNS like servername-001, -002, etc. and configure your backends to accept those names as a ServerAlias for the VirtualHost you're aiming for. Of course you could also just set the VirtualHost as default so it works using the IP and omit this last step, assuming your App doesn't assume it's running with a particular name.

Edit: This may be useful - it's a Firefox extension that lets you modify request headers. You could arguably modify Host to visit the backends directly specifying a ServerName. I haven't tried it though.



You need to modify the HTTP Host header.



I do this with curl:

curl -H host:servername

You may find the following plugins useful:



  • I edited my post with the same URL before seeing your contribution! Hope you don't mind. +1 for curl. – Eduardo Ivanec May 18 '11 at 19:43
  • @Eduardo, not at all. I've been messing around with this exact problem lately and using the curl approach myself. Couldn't find anything useful for OP on the chrome front. – dmourati May 18 '11 at 19:46
  • Definitely +1 for the curl tip. Thanks! – Bryan Agee May 18 '11 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.