YMMV
Try this, it works with proxying xbt, but not tested with cloudflare:
Code:
location ~ ^/(.*?)/announce$ {
proxy_pass http://127.0.0.1:2710/$1/announce$is_args$args&ip=$remote_addr;
proxy_set_header Host $host;
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 $remote_addr;
proxy_pass_header Content-Type;
proxy_pass_header Content-Disposition;
proxy_pass_header Content-Length;
proxy_buffering off;
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
proxy_buffers 4 256k;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
real_ip_recursive on;
}
nginx variables to explain those used above. You may or may not need all of those headers.