Forum: NGINX Simple session persistence base on IP address?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3f99486e5c99903f7279790e27b9ae37?d=identicon&s=25 Gio (Guest)
on 2008-10-28 17:51
(Received via mailing list)
I've read that ppl use NginxHttpUpstreamRequestHashModule for session
persistence. But I'm not sure how it works. Where can I get documention
about it?
Have any more simple way to do session persistence base on client IP
with
nginx?
giobuon.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 mike (Guest)
on 2008-10-28 19:49
(Received via mailing list)
I'll give you the advice I give everyone else: forget session
persistence. Use a central session store. Plenty of options out there
for it. To me session persistence and such is how it was done in the
90's..

- my two cents :)
2e321cc0efe9422d37165e922298494e?d=identicon&s=25 Cliff Wells (Guest)
on 2008-10-28 20:43
(Received via mailing list)
On Tue, 2008-10-28 at 11:41 -0700, mike wrote:
> I'll give you the advice I give everyone else: forget session
> persistence. Use a central session store.

Or a distributed session store if scalability is a big concern.
Memcached is designed to do this very thing.

Cliff
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 mike (Guest)
on 2008-10-28 20:57
(Received via mailing list)
yes that's what i meant with "plenty of options"

depending on how important sessions are you can determine if you need
memcached alone, memcached with db-backing (what is that, a
"write-through cache" ?) etc
E6b3e2d0ff42df5214e02af22c364792?d=identicon&s=25 ryo sato (Guest)
on 2008-10-29 01:35
(Received via mailing list)
> Have any more simple way to do session persistence base on client IP
 > with nginx?


Use "$remote_addr" var.
Like this.

     upstream www {
         server x.x.x.x:80 ;
         server y.y.y.y:80 ;
         hash   $remote_addr;
     }
3f99486e5c99903f7279790e27b9ae37?d=identicon&s=25 Gio (Guest)
on 2008-10-29 08:26
(Received via mailing list)
Thanks all. But what about SSL or some services like ftp?
2e321cc0efe9422d37165e922298494e?d=identicon&s=25 Cliff Wells (Guest)
on 2008-10-30 08:53
(Received via mailing list)
On Wed, 2008-10-29 at 14:16 +0700, Gio wrote:
> Thanks all. But what about SSL or some services like ftp?

Both are irrelevant, SSL must be handled by the proxy regardless of
where the request is ultimately forwarded (limitation of SSL, not
Nginx), and Nginx doesn't proxy FTP, only HTTP (and IMAP/POP3, if you
choose).

Regards,
Cliff
This topic is locked and can not be replied to.