Fail2ban requires IP in seahub.log but IP disappeared during some release upgrade

I recently detected fail2ban doesn’t work any more on my seafile server. I know it worked when I initially installed seafile. Looks like during some release upgrade the IP disappeared in seahub.log and fail2ban doesn’t work any more.

There exists No IP addresses in seahub.log which explains what to do to get the IP. Unfortunately this doesn’t work any more :-(.

The referenced thread says I should add

fastcgi_param REMOTE_ADDR $remote_addr;

but fastcgi is no loner used in Seafile 7.0.5.

That’s my current nginx config for seafile:

location / {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;

 # used for view/edit office file via Office Online Server
 client_max_body_size 0;

 access_log      /var/log/nginx/seahub.access.log;
 error_log       /var/log/nginx/seahub.error.log;


What’s the correct way to get back again the IPs in seahub.log?

I just detected I don’t need seahub.log to reject massive 404 requests from site attackers. I just need /var/log/nginx/seafile.access.log and this file includes IP addresses fail2ban requires.