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.