Modify your Nginx configuration to trust the proxy headers. In your server block, add:

/etc/nginx/sites-available/peertube

real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;