What you are looking for is ngx_http_realip_module:
http://nginx.org/en/docs/http/ngx_http_realip_module.html
There is a “real_ips” option in Bitwarden’s config.yml where you can add the IPs of trusted forwarders, e.g. a proxy server.
It simply adds blocks like this to bwdata/nginx/default.conf:
set_real_ip_from 172.22.0.1;
real_ip_header X-Forwarded-For;
real_ip_recursive on;