Reverse proxy, downstream Real-IP
Posted: Wednesday 26 May 2021 11:18
hi all,
TLDR: request to implement logging of X-Real-IP
I am running Domoticz behind a NGINX reverse proxy with public IP access to connect from the Internet. Unfortunately, I don't see the X-Real-IP (or X-Forwarded-for header) from the downstream request (public IP) being passed to the upstream server (ie: Domoticz). In my Domoticz logs, I always see the IP address of my NGINX server (a private IP).
I realize that in the Domoticz settings you can set your reverse proxy IP address to require authentication, but this is not the problem here. I would really like to see in my logs from which downstream (Internet) IP address users are connecting from. Apart from an information point of view, this would also allow to setup fail2ban to mitigate brute force attacks.
So would it be possible to log the X-Real-IP header (if present) instead of the IP address? Should I request this on the GitHub page?
Thanks for your help!
TLDR: request to implement logging of X-Real-IP
I am running Domoticz behind a NGINX reverse proxy with public IP access to connect from the Internet. Unfortunately, I don't see the X-Real-IP (or X-Forwarded-for header) from the downstream request (public IP) being passed to the upstream server (ie: Domoticz). In my Domoticz logs, I always see the IP address of my NGINX server (a private IP).
I realize that in the Domoticz settings you can set your reverse proxy IP address to require authentication, but this is not the problem here. I would really like to see in my logs from which downstream (Internet) IP address users are connecting from. Apart from an information point of view, this would also allow to setup fail2ban to mitigate brute force attacks.
So would it be possible to log the X-Real-IP header (if present) instead of the IP address? Should I request this on the GitHub page?
Thanks for your help!