Skip to content
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

add cloudflare connecting ip to self info plugin #234

Closed
winneratwin opened this issue Jul 30, 2021 · 3 comments
Closed

add cloudflare connecting ip to self info plugin #234

winneratwin opened this issue Jul 30, 2021 · 3 comments
Labels
new feature New feature or request

Comments

@winneratwin
Copy link

Is your feature request related to a problem? Please describe.

it doesn't show the correct ip behind cloudflare

Describe the solution you'd like

add Cf-Connecting-Ip header to the list of headers that the self info plugin uses when the query is ip

Describe alternatives you've considered

there is another header True-Client-IP in cloudflare enterprise plan but the Cf-Connecting-Ip header is always active

Additional context

none required

@winneratwin winneratwin added the new feature New feature or request label Jul 30, 2021
@unixfox
Copy link
Member

unixfox commented Jul 30, 2021

Searx is usually run behind a reverse proxy, so you must configure your reverse proxy to forward the given client IP address by cloudflare to Searx.

In no way this is Searx fault.

@return42
Copy link
Member

return42 commented Jul 30, 2021

@dalf
Copy link
Member

dalf commented Jul 30, 2021

At this line

x_forwarded_for = request.headers.getlist("X-Forwarded-For")

you can replace X-Forwarded-For by Cf-Connecting-Ip, it should work.

But it won't be supported in this repository for the reasons described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants