Nginx基于IP的负载均衡
我们目前使用 Nginx 服务器进行负载平衡。我们希望我们的办公室 IP 被重定向到特定服务器,而所有其他流量都正常负载平衡。
这可能吗?
We currently use an Nginx server for load balancing. We would like our office IP to be redirected to a specific server, where as all other traffic is load balanced normally.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用任何 Web 服务器(Apache、Tomcat、nginx 等)进行简单的重定向。
例如,在 Java 上,您可以使用以下内容创建一个简单的 index.jsp:
这段代码将每个请求重定向到给定的 URL,在您的情况下重定向到负载均衡器。
You can do a simple redirect with any web server (Apache, Tomcat, nginx, etc).
For example, on Java you can create a simple index.jsp with the following:
This piece of code will redirect each request to the given URL, in your case to the load balancer.
这不是一个有效的配置,但我希望主要思想是清楚的
This is not a working config but I hope the main idea is clear