Redirect to a web server depending on location with nginx
Im working on a web site that has to be reachable from many countries under the same domain.
Id like to know开发者_运维问答 how can I receive a request with nginx (or any other static file server), and send it to different web servers depending on IP's location.
I mean, what is the point on having multiple db machines on country A and B, if the server that serves you the page is chosen by round robin.
Maybe theres another solution to my problem, and I would be very happy if someone can explain it to me.
It sounds like you are looking for a geographic page re-director.
This company provides a solution that will do the trick: www.geobytes.com
The idea is that your web server will redirect visitors to a location specific HTML page. So that, a guy in India that visits www.example.com will be shown a page customized for India, while a visitor from say Canada will see the Canadian home page.
It looks like they have PHP(http://forums.geobytes.com/viewtopic.php?f=9&t=6815) and Javascript APIs.
Some of their products are free, like the geographic page re-director(http://www.geobytes.com/GeoDirection.htm)
Hope it helps.
As stackoverflow is for programming issues, You’ll probably get a better response at https://serverfault.com/, which is geared toward “Networking, servers, or maintaining other people's PCs”. (See the FAQ.)
精彩评论