Skip to content

Conversation

@mahdibashirpour
Copy link
Contributor

This pull request fixes the issue where the request()->ip() method doesn't return the correct IP address when using a reverse proxy (such as Nginx or Cloudflare).
When a reverse proxy is used, the IP address of the proxy is returned instead of the client's real IP. To address this, the code now checks the X-Forwarded-For header to retrieve the correct client IP.

@milwad-dev milwad-dev linked an issue Dec 16, 2024 that may be closed by this pull request
@milwad-dev milwad-dev changed the title Fix IP address retrieval when using reverse proxy [1.x] Fix IP address retrieval when using reverse proxy Dec 16, 2024
@milwad-dev
Copy link
Member

Thanks!

@milwad-dev milwad-dev merged commit f721646 into binafy:1.x Dec 16, 2024
1 check passed
@mahdibashirpour
Copy link
Contributor Author

mahdibashirpour commented Dec 16, 2024

@milwad-dev
You're welcome, Milwad!

Please update the README to reflect the new configuration options, including use_reverse_proxy_ip.

Thank you!

@mahdibashirpour mahdibashirpour deleted the fix/ip-reverse-proxy branch December 16, 2024 10:17
@milwad-dev
Copy link
Member

Yes ofcourse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with Storing IP Address in Database When Using Reverse Proxy

2 participants