<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.foxdiv20140519084438027280 { }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div>谢谢你的回复:</div><div><span></span>  我描述的有点问题,我的需求是不管前端有多少代理或者路由 在最后一层的nginx做代理时,能将同一个客户端的请求都代理到同一个web服务器上。<span style="font-family: 微软雅黑, Tahoma; font-size: 13px; font-weight: bold; line-height: normal; white-space: nowrap; background-color: window;">Aleksandar Lazic 提供的方案正是我所需要的。</span></div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>gaoping@richinfo.cn</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:renenglish@gmail.com">Shafreeck Sea</a></div><div><b>Date:</b> 2014-05-16 18:55</div><div><b>To:</b> <a href="mailto:nginx@nginx.org">nginx@nginx.org</a></div><div><b>Subject:</b> Re: Re: nginx1.4.7 ip_hash load balancing strategy</div></div></div><div><div class="FoxDiv20140519084438027280"><div dir="ltr">必须用ip_hash ? 另外我也没太看明白你的问题。<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-16 16:17 GMT+08:00 <a href="mailto:gaoping@richinfo.cn">gaoping@richinfo.cn</a> <span dir="ltr"><<a href="mailto:gaoping@richinfo.cn" target="_blank">gaoping@richinfo.cn</a>></span>:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div>
<div><span></span><span style="font-family:monospace;font-size:medium;line-height:normal">ngx_http_upstream_module </span><span style="background-color:rgb(255,255,255)"><span style="border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;font-family:arial;font-size:12px;line-height:22px">Load balancing</span><span style="font-family:arial;font-size:12px;line-height:22px"> </span></span><span style="background-color:window;font-family:arial;font-size:12px;line-height:22px">algorithm upstream</span><span style="background-color:window;font-family:arial;font-size:12px;line-height:22px"> the instruction ip_hash;</span></div>
<div><br></div><hr style="width:210px;min-height:1px" align="left" color="#b5c4df" size="1">
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:gaoping@richinfo.cn" target="_blank">gaoping@richinfo.cn</a></div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT:8px;PADDING-LEFT:8px;FONT-SIZE:12px;FONT-FAMILY:tahoma;COLOR:#000000;BACKGROUND:#efefef;PADDING-BOTTOM:8px;PADDING-TOP:8px">
<div><b>From:</b> <a href="mailto:renenglish@gmail.com" target="_blank">Shafreeck Sea</a></div><div><b>Date:</b> 2014-05-16 16:14</div><div><b>To:</b> <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a></div>
<div><b>Subject:</b> Re: nginx1.4.7 ip_hash load balancing strategy</div></div></div><div><div class="h5"><div><div><div dir="ltr">why ip_hash ?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-16 15:29 GMT+08:00 <a href="mailto:gaoping@richinfo.cn" target="_blank">gaoping@richinfo.cn</a> <span dir="ltr"><<a href="mailto:gaoping@richinfo.cn" target="_blank">gaoping@richinfo.cn</a>></span>:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div>
<div><span></span>hi</div><div>     <span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px">When my nginx</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> is</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> below</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> this structure,</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">Nginx</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> access to the</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> IP</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> proxy server</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> by</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> IP</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">,</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> then</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> nginx</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> ip_hash</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> load balancing</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">,</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> will</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> all requests are</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> routed to</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> the same tomcat</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">,</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> do not know if you have</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> what</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"> good method to solve the</span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">.</span></div>
<div><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px">   </span><span style="font-size:10.5pt;background-color:window;color:rgb(51,51,51);font-family:arial;line-height:22px"><span style="font-size:13px"> </span></span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px">The ip_hash function</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> can be</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> introduced into</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:13px;line-height:22px"> a custom IP.</span><span style="background-color:window;color:rgb(51,51,51);font-family:arial;font-size:10.5pt;line-height:22px">      </span></div>
<div>    <font color="#ff0000"> <span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">Prerequisite</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">:</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> can not</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> change the existing</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> structure</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">,</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> and</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> nginx access to the</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> IP is only a</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">proxy server</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">,</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> and</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> IP</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> client</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> request is</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> not</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px"> true</span><span style="font-size:10.5pt;background-color:window;font-family:arial;line-height:22px">,</span></font></div>
<div><span style="color:rgb(51,51,51);font-family:arial;line-height:22px">  </span></div>
<div><img src="cid:_Foxmail.1@397becf6-a49b-98b2-fa87-4cd19bcd3699" border="0"></div><hr style="width:210px;min-height:1px" align="left" color="#b5c4df" size="1"><span><font color="#888888">
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:gaoping@richinfo.cn" target="_blank">gaoping@richinfo.cn</a></div></div></span></div>
</font></span></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
</div></div></div></div></blockquote>
</div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
</div></div></blockquote>
</body></html>