根据 nginx 的位置重定向到 Web 服务器

发布于 2024-09-01 13:34:36 字数 214 浏览 1 评论 0原文

我正在开发一个必须可以从同一域下的许多国家/地区访问的网站。

我想知道如何使用 nginx(或任何其他静态文件服务器)接收请求,并根据 IP 位置将其发送到不同的 Web 服务器。

我的意思是,如果为您提供页面的服务器是通过循环法选择的,那么在 A 国和 B 国拥有多台数据库计算机有什么意义。

也许我的问题还有另一种解决方案,如果有人可以向我解释它,我会非常高兴。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情场扛把子 2024-09-08 13:34:36

听起来您正在寻找地理页面重定向器。

这家公司提供了一个可以解决这个问题的解决方案:www.geobytes.com

这个想法是您的网络服务器将访问者重定向到特定位置的 HTML 页面。这样,访问 www.example.com 的印度用户将看到为印度定制的页面,而来自加拿大的访问者将看到加拿大主页。

看起来他们有 PHP(http://forums.geobytes.com/viewtopic.php?f=9&t=6815) 和 Javascript API。

他们的一些产品是免费的,例如地理页面重定向器(http://www.geobytes.com/GeoDirection.htm)

希望它有所帮助。

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.

笛声青案梦长安 2024-09-08 13:34:36

由于 stackoverflow 是针对编程问题的,因此您可能会在 https://serverfault.com/ 上得到更好的答复,该网站面向“网络” 、服务器或维护其他人的 PC”。 (请参阅常见问题解答。)

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文