Domino upstream webserver: how to get downstream IP in logs when using Nginx

Started by peter.vynck, February 18, 2021, 03:33:33 PM

Previous topic - Next topic
Recently installed Nginx on one of the OPNsense devices I manage.
One of the upstream webservers there is a HCL Domino 11 server.

How to get the downstream (client) IP address in the domlog.nsf?

Found this post https://blog.nashcom.de/nashcomblog.nsf/dx/fail2ban-support-for-domino-intrusion-detection.htm to get me started.
Changed the notes.ini by adding HTTP_LOG_ACCESS_XFORWARDED_FOR=1 in order for Domino to register those headers.

In the HTTP Server config TAB in OPNsense, using the advanced mode, choose X-Forwarded-For as Real IP Source. This will add the right headers to the requests to the Domino server.

I changed the domlog.ntf as follows:
- I edited the form fmLogEntry and added the field ForwaredFor next to UserAddress
- I edited the view All Requests and changed the Formula for the column Remote User by replacing UserAddress with ForwaredFor

Doing this now gives me the client IP instead of the OPNsense address in that form and view. You can change the other forms and views accordingly if needed.

Drop me a line in case you want a copy of the edited template.

hm
sorry, but
plugin already adds "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" on any location by default

QuoteHTTP Server config TAB in OPNsense, using the advanced mode, choose X-Forwarded-For as Real IP Source
thats actualy sets the real_ip_header directive and needed only if nginx itself is behind some proxy
https://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header

You are right. That part can be dismissed.

So it's basically the Domino side that needs tweaking...