<div dir="ltr">Grzegorz,<div><br></div><div>While your proposed solution provides a clever way to stick requests to the same node, it doesn't provide a way to fulfill the first part of my requirement: dispatching the first 100 requests with Referer=<a href="http://www.somedomain.com">www.somedomain.com</a> to nodeA and the next 100 to nodeB. <span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80); ">UPSTREAM_FAIR looks great but it doesn't fill this need.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);">Maybe a little background would help. This is a comet application (hence the need for sticky sessions) and its using a shared memory system (Terracotta) for multiple nodes. Because of how we built it, the shared memory works much faster when users from the same referer are grouped on the same node, hence the need for this requirement.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);">Is there any way to do this second requirement without coding something?</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);">Thanks,</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80);">Brian<br></span><br><div class="gmail_quote">On Thu, Sep 25, 2008 at 3:16 AM, Grzegorz Nosek <span dir="ltr"><<a href="mailto:grzegorz.nosek@gmail.com">grzegorz.nosek@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Thu, Sep 25, 2008 at 03:56:36PM +0800, Jeffrey 'jf' Lim wrote:<br>
> uh... right - that's the magical "something" there... ;)<br>
<br>
</div>:)<br>
<br>
How about embedding the upstream ID in the URL or query string and<br>
matching that using the rewrite module? Or as a part of cookies sent to<br>
the client (you could match that via $http_cookie, altough I seem to<br>
remeber that there was a special module for that). So a backend sets a<br>
cookie containing e.g. "backend=1" (along with any other data).<br>
<br>
I think you could match it like this:<br>
<br>
location / {<br>
if ($http_cookie ~ backend=1$) {<br>
<div class="Ih2E3d"> proxy_pass <a href="http://up_1" target="_blank">http://up_1</a>;<br>
}<br>
</div> # etc.<br>
}<br>
<br>
Unfortunately you have to pass something to the client but a cookie will<br>
probably be the least ugly.<br>
<br>
Best regards,<br>
<font color="#888888"> Grzegorz Nosek<br>
<br>
</font></blockquote></div><br></div></div>