Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r18119: minor update for Moscow dev servers behi...

Committer: gariev
minor update for Moscow dev servers behind nginx proxy: pass real user IP to server
U   trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2011-01-26 11:37:27 UTC (rev 18118)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2011-01-26 11:41:51 UTC (rev 18119)
@@ -133,6 +133,14 @@
                 }
                 LJ::Request->header_in('X-Forwarded-For', join(", ", @hosts));
             }
+            
+            ## Moscow dev server through nginx proxy
+            if ($LJ::IS_DEV_SERVER) {
+                if (my $real_ip = LJ::Request->header_in('X-Real-IP')) {
+                    push @req_hosts, $real_ip;
+                    LJ::Request->remote_ip($real_ip);
+                }
+            }
 
             # and now, deal with getting the right Host header
             if ($_ = LJ::Request->header_in('X-Host')) {

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments