문제

I'm running a service in localhost at 127.0.01:8000

and I'm proxying this by using:

proxy_pass http://127.0.0.1:8000;

Problem is that I need to pass the user's IP address to the service.


Any ideas?

도움이 되었습니까?

해결책

I send the real IP to django by setting a custom header:

proxy_set_header X-Real-IP $remote_addr;

Those headers are available in request.META

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top