Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I my deployment enviroment I use local Hosts file to change domains destination to another server I use for development. It works nice and it's easy to setup. But as always there is a catch. If our client wants to see the dev site before its deployment to main server, we can't force him to set his hosts file, so he can't reach the site.

I was thinking that there must be some online tool that redirects any requests sent to it to server by your definition. So I would just send link to my client and he wouldn't notice anything, just like web proxy. I was googling for this but didn't find anything usefull.

Does anybody of you know any tool for this? (I don't care if its free or paid solution. I would probably write it on my own, I just don't want to reinvent the wheel.)

If it doesn't exist, what deployment solution/prodecure would you recommend?

Thanks for all responses

share|improve this question
Can you please give more details about the current setup? – Mircea Vutcovici Aug 15 '12 at 18:07
Thats for a long story. Thank you for your exhausting answer, you've given enought possible solutions to this. I'll will accept it, because nobody else seems to know the tool for this. – Marakoss Aug 16 '12 at 7:17
up vote 2 down vote accepted

You should use a DNS server and have different domains for the development site and production one. E.g. vs.

Your site should not be dependent on the DNS name, because site names can change. Imagine that you have and your company is purchased by example2 and you have not only to change the hostnames and certificate to but also your code.

Another way to do it is to expose the dev site as To do this you can use a reverse proxy that redirects /dev to the internal dev site. If you give details about your architecture it is much easier for our comunity to give a better solution.

It is also possible to show different sites (prod vs dev) depending on other factors like source IP, authentication, a HTTP cookie...

You can also keep the public server on port 80/TCP and the dev on a different port, like 8080/TCP. Or you can have the HTTPS site the dev one.

share|improve this answer
almost same answer at the same time ;) – user130370 Aug 15 '12 at 15:24
We actually can serve for each subdomain another site. But only if DNS server is in your competition and if we have access to server files. Imagine situation where client have already some website made by another company. I'm looking for time-saving solution, because this happens a lot. Also we have zero-fail tolerance and hosts allows you to test your website as it'll be on production sever. – Marakoss Aug 15 '12 at 15:29
The simplest one would be a reverse proxy like: for example1 company dev site and for the example2 company dev site. – Mircea Vutcovici Aug 15 '12 at 18:09
Something like reverse proxy would work, but not fully. The links within the site (lets say would still aim to ... So once the client click on that link, it would redirect him to production version so it wouldn't work. – Marakoss Aug 16 '12 at 7:20
Thats why I was looking for some tool that has this things fixed (every online web proxy can do this) – Marakoss Aug 16 '12 at 7:22

DNS is the simplest solution if your client doesn't want to modify /etc/hosts.

Just make point at the dev website. Don't forget to allow only your client to access (password, firewall, acl ...).

That won't work if the website needs visitors to type, but what you describe in your question won't work too in such a situation.

I haven't heard of any online tool that can do what your describe, but all the proxy servers I know (varnish, apache and even squid) know how to forward any http request to the same backend.

share|improve this answer

Keep it simple. I'd either use a reverse proxy as suggested by Mircea or just host the site in a temporary location (subdomain, domain, or folder).

share|improve this answer

Your Answer


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.