Logging external ip behind reverse proxy

9.1.x
help

#1

I have a instance of ownCloud 9.1.0 (stable), and I'm trying to set up fail2ban. The problem is that the owncloud log has my reverse proxy ip not the external ip. I'm using a NGINX reverse proxy which has "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" set in the the config. I have also added " 'forwarded_for_headers' => array('HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR')," in config.php. Any help would be greatly appreciaated. 


#2

Hi,

have a look at this comment for some pointers:


#3

Thanks for the help, I had come across that post before but obviously didn't read it close enough. For those who may find this post this is what I implemented.

In NGINX

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

In owncloud config.php

'trusted_proxies' => array ('IP of proxy'),
  'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR', 'HTTP_FORWARDED_FOR'),