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';


On Friday, March 18, 2016 at 12:05:28 AM UTC+11, Pavel K wrote:
>
> I suggest that your website over NGINX or mod_proxy ?
> In that case try this
>
> $c->req->headers->header('X-Real-IP');
>
> $c->req->headers->header('X-Forwarded-For');
>
> and
>
> $c->tx->remote_address; (double s)
>
>
> четверг, 17 марта 2016 г., 3:13:55 UTC+3 пользователь varun malhotra 
> написал:
>>
>> Hi Guys,
>>
>> I have been looking for a solution to one of my blockers here.
>>
>> I have a website created with Mojolicious Framework.
>> There I have a user login functionality.
>>
>> I wanted to grab the user's/Visitor's details like Visitor's IP, OS, 
>> Browser, etc.
>>
>> I have tried setting 'MOJO_REVERSE_PROXY=1' and then used ' 
>> $self->tx->remote_addres' but it returns the reverse proxy address 
>> 127.0.0.1 instead of my machine IP from where I was accessing the website.
>>
>> I have also tried %ENV but of no use.
>>
>> Appreciate any suggestion.
>>
>> Vroom
>>
>>
>>

-- 
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