1

Let's say my current website is running on machine A. I plan to launch new website on Machine B. Now I want to make this new website live to users belonging to some particular location only (IP based). This would allow us to test new site without disturbing existing setup and before making it open to all.

What kind of setup (servers/reverse proxy/IP database etc) would be recommended? Any problem with this approach (apart from redirect delay and possible SEO problems)?

Thanks for your help.

5
  • Are these servers sharing a web-facing IP address? Jul 6, 2012 at 20:56
  • @Joel: both servers have different IP and hosted on different locations. So probably some kind of DNS balancing would be required as well.
    – ucker
    Jul 6, 2012 at 20:58
  • Do you run your own DNS servers? Jul 6, 2012 at 21:12
  • @Joel: No. We do not run our own DNS servers.
    – ucker
    Jul 6, 2012 at 21:16
  • Do you have load balancers in place?
    – mrdenny
    Jul 7, 2012 at 3:08

2 Answers 2

0

Ok if you want a really simple solution and the list of IP users is short just use .htaccess and apache RewriteEngine on Machine A.

For example add this to your .htaccess:

RewriteCond %{REMOTE_ADDR} ^(192\.168\.0\.12)$  [OR]
RewriteCond %{REMOTE_ADDR} ^(192\.168\.0\.13)$  
RewriteRule ^(.*)$ http://other.webserver.com/$1 [P]

If not just check the documentation for apache mod_proxy.

If that's not enough you can use solutions like varnish, nginx proxy, HAproxy, but you will need to reconfigure apache on machine A and add complexity to your solution.

1
  • this rewrite should be 302 redirect, right?
    – ucker
    Jul 7, 2012 at 4:56
1

There's no shortage of options here. Pretty much every webserver I've played with has the ability to examine and act differently depending on the client IP address, and once you've got that functionality you can just route the request to different places based on the IP address rules you setup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .