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

get_client_ip returns the wrong value #62

Closed
elkd opened this issue Jan 17, 2021 · 2 comments
Closed

get_client_ip returns the wrong value #62

elkd opened this issue Jan 17, 2021 · 2 comments

Comments

@elkd
Copy link

elkd commented Jan 17, 2021

In the beginning, the function was working perfectly but all of the sudden like 3 days ago things just changed. when I query it returns the private IP address of the network load balancer. My config is like
client -> Network LB -> Application LB -> Nginx -> Django server

I just call the function with default values, I didn't pass the arguments like proxy count or trusted IPs. Are these values a must or it is the issue with LB configuration?

Any idea, please help?

@un33k
Copy link
Owner

un33k commented Jan 18, 2021

@elkd I do recommend to;
1- pip uninstall django-ipware and pip install django-ipware. If that solves the problem, then great if not cont. w/ step 2
2- If it worked, and it is not working now, if the ipware version is not changed, then look at the network LB for misconfiguration
3- If you don't have access to the upstream network LB config, then you are out of luck ..

ipware can show you what it receives. If the bad ip or spoofed IP is passed down the chain, then you may not be able to do anything about it.

@elkd
Copy link
Author

elkd commented Jan 18, 2021

Thank you so much for your prompt response. The issue is with the Network Load Balancer, I'll close the issue for now as I communicate with the infra guys. If the server still misbehaves I'll re-open the issue.

@elkd elkd closed this as completed Jan 18, 2021
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

No branches or pull requests

2 participants