-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not detect IP Client #371
Comments
Are you using a reverse proxy like Nginx in front of Laravel Swoole? |
I'm using apache2, this is the configuration
|
Sorry for the inconvenience, I have managed to fix it, I put the solution here in case someone else also happens the same. The problem was that the proxy ip (127.0.0.1) was not set in the TrustProxies middleware. This can be a common mistake among newbies who have never used a proxy, as the tutorials do not say anything about this middleware. |
Description:
When using Request::ip() and request()->ip() to get the client's ip, it returns the ip 127.0.0.1. I want to clarify, that laravel is running on a server with an associated domain, not on a local machine.
Steps To Reproduce:
routes/web.php
The text was updated successfully, but these errors were encountered: