8000 [ENHANCEMENTS] Automatically pass through the real IP instead of the cloudflare IP's · Issue #676 · tobychui/zoraxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ENHANCEMENTS] Automatically pass through the real IP instead of the cloudflare IP's #676

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

Open
hax4dazy opened this issue May 27, 2025 · 9 comments
Labels
enhancement New feature or request

Comments

@hax4dazy
Copy link

Is your feature request related to a problem? Please describe.
Currently, my home assistant is getting flooded with pings / bad logins. It shows the cloudflare relay IP address instead of the actual IP.

Describe the solution you'd like
Since zoraxy can block / ban IP's it would be nice if the real IP addresses was passed down so that I can just ban them.

Describe alternatives you've considered
N/A

Additional context
Not sure if this already exists, it clearly does for Zoraxy itself but it doesn't yet pass the real IP's down

@hax4dazy hax4dazy added the enhancement New feature or request label May 27, 2025
@tobychui
Copy link
Owner

@hax4dazy No it do pass down the real-ip as X-Real-IP. It is more likely be a problem on your setup / HA side.

You can try tinkering with the custom header and pass the remote IP manually to see if it helps.
https://github.com/tobychui/zoraxy/wiki/Custom-Headers

@hax4dazy
Copy link
Author

Well when i was on nginx it worked fine when adding the real_ip_header X-Forwarded-For; header's. When I switched to zoraxy it stopped working so I doubt its a setup issue, nothing has changed apart from my forwarder

@tobychui
Copy link
Owner
tobychui commented May 28, 2025

@hax4dazy Maybe this is another case of where open source projects just dont follow the X-forwarded-for standard and just adopt Nginx's reversed X-forwarded-for header design. Try use the custom header function to override the forward header to the $remote_ip variable.

@hax4dazy
Copy link
Author

Could you tell me how? I'm a bit stupid when it comes to headers and adding / removing custom headers.

@tobychui
Copy link
Owner

@hax4dazy Something like this

Image

@hax4dazy
Copy link
Author

I tried that but it didn't work. This is me logging in with fake credentials that don't exist

Image

Image

@elsherif896
Copy link

@tobychui under https://github.com/tobychui/zoraxy/wiki/Custom-Headers there is a mention of $remote_addr rather than $remote_ip (which you mentioned here), is this a custom thing? Can i use it without worries, as $remote_addr did not do anything for me?

Image

@tobychui
Copy link
Owner
tobychui commented Jun 3, 2025

@elsherif896 This is an experimental variable I added into the recent pre-release for removing the port number from $remote_addr. You can test out the header sent by Zoraxy by setting up a simple LAMP / UwAMP instance and access this php script via Zoraxy.

debug.zip

@james-d-elliott
Copy link
Contributor

Apologies if I'm being lazy necessarily and this has either been discussed here or is already a feature.

This kind of thing usually needs a specific trust system specifically for the IP headers from upstream proxies.

How I'd suggest this probably works in the future at some stage is that Zoraxy adds a list of trusted proxies, then when a request comes through a well known variable is set (maybe $remote_ip). If the TCP src IP is trusted, this is whatever the various headers (maybe customizable?) claim it is, otherwise it's the TCP src IP.

It may even be worth having a set of "completely trusted" proxies where headers like X-Forwarded-For are trusted to have completely correct information, and "partially trusted" proxies where headers like X-Forwarded-For are iterated over until the first untrusted IP is found (which would be the client IP since all previous IP's were partially trusted proxies).

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

No branches or pull requests

4 participants
0