jeudi 17 mars 2016, 20:39:16 CET varun malhotra wrote:
> Thanks Pavel but I tried that too. :(
> 
>         $self->req->headers->header('X-Real-IP');
>         $self->req->headers->header('X-Forwarded-For');
>         ####The below code logs the $self->tx->remote_port, etc 
>         $self->app->log->info(Dumper($self->tx->remote_port));
>         $self->app->log->info(Dumper($self->tx->remote_address));
>         $self->app->log->info(Dumper($self->tx->original_remote_address));
> 
> What I get in return is :
> 
> [Fri Mar 18 14:31:08 2016] [info] $VAR1 = '45835';
> [Fri Mar 18 14:31:08 2016] [info] $VAR1 = '127.0.0.1';
> [Fri Mar 18 14:31:08 2016] [info] $VAR1 = '127.0.0.1';
> 

You need to configure your webserver properly. For Nginx :

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Remote-Port $remote_port;

-- 
Luc
http://www.fiat-tux.fr/
Internet n'est pas compliqué, Internet est ce que vous en faites.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to