-
Notifications
You must be signed in to change notification settings - Fork 27
IP Returned Incorrectly #5
Comments
As it shows in the description, this plugin writes the X-Real-Ip header, not the 'x-forwarded-for' header.
|
Line 70 in 4ba5e86
The plugin also sets the X-Forwarded-For based on the Cf-Connecting-Ip if X-Real-IP can't be pulled from X-Forwarded-For. |
I see what you mean. I set up a test that didn't include cf-connection-ip and I get a similar result |
same here, I used another plugin and it worked well |
@simon-sudo mind if I ask you how you configured Cloudflare? I'm struggling with configuring the rule expression in the Cloudflare rule to rewrite the header. I have the same issue with just Home Assistant, I'm having the same result with the extra , like the results above. |
add this plugin to the configuration file: experimental:
plugins:
real-ip:
moduleName: github.com/Paxxs/traefik-get-real-ip
version: [Please fill the latest version !] set two values like this:
http:
middlewares:
real-ip-foo:
plugin:
real-ip:
Proxy:
- proxyHeadername: X-From-Cdn
proxyHeadervalue: cf-my
realIP: Cf-Connecting-Ip
OverwriteXFF: true
- proxyHeadername: "*"
realIP: RemoteAddr Reference : https://github.com/Paxxs/traefik-get-real-ip#cdn-configuration |
@simon-sudo Brilliant, the expression was all I wanted to know, the rest I had correct. Much much appreciated, working like a charm now! |
Can confirm. Noticed that I could not access home assistant from lan after enabling this plugin. The error log displays |
Plugin returns IP as ", 123.123.123.123" instead of just "123.123.123.123"
Configuration:
Docker
middlewares.toml:
Test:
Home Assistant:
Invalid IP address in X-Forwarded For: , 192.168.XX.XX
Whats My IP Container result:
, 192.168.XX.XX
Same issue with setting
excludednets
equal to0.0.0.0/32
,0.0.0.0/0
, or any of the individual options above. Seems to work fine for any external IP addresses, just internal causes issues.The text was updated successfully, but these errors were encountered: