I already said I can't change settings on the load balancer.  There is
no default route on this network so the traffic must be sourced from
the inside interface of the load balancer as it hits the web server.

Here's the problem:

diff -r 9619eb054669 gluon/globals.py
--- a/gluon/globals.py  Tue Dec 27 10:16:19 2011 -0600
+++ b/gluon/globals.py  Tue Dec 27 17:07:00 2011 -0500
@@ -548,7 +548,7 @@

         (record_id_name, table, record_id, unique_key) = \
             response._dbtable_and_field
-        dd = dict(locked=False, client_ip=request.env.remote_addr,
+        dd = dict(locked=False, client_ip=request.client.replace(':',
'.'),
                   modified_datetime=request.now,
                   session_data=cPickle.dumps(dict(self)),
                   unique_key=unique_key)

The code for storing sessions on disk was using request.client which
checks http_x_forwarded_for before using remote_addr.  The code for
writing the session to database was just using remote_addr which was
always showing my private IP of the load balancer.  The above patch
should take care of it.

Thanks,
Dave

On Dec 23, 7:40 pm, pbreit <pbreitenb...@gmail.com> wrote:
> What web server are you running? On Nginx there's a module to take the
> x-forwarded-for and make it the client ip.
>
> http://wiki.nginx.org/HttpRealIpModule

Reply via email to