Quote:
Originally Posted by darkalchemy
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.
|
You don't want to use that code that you added. The code that I added is from the creator of the Xbt Tracker. And what it does is just rewrites all announces and scrapes to add the users ip in the string. This rewrite is needed because information is passing through Cloudflare and the users ip doesn't get passed on without this method.
I know this looks simple but that's all that's needed, trust me I've looked at what it does in the Xbt Tracker Access logs:
Code:
server {
listen 8080;
server_name localhost;
location / {
rewrite ^(.*)$ $1?ip=$remote_addr break;
proxy_pass http://127.0.0.1:2052/;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
access_log off;
log_not_found off;
}
}
This is what it does:
Code:
servertime (actual ip that's shown) = 127.0.0.1 (otherinfohere) GET /users-passkey/announce?ip=users-ip-address-here&info_hash=users-hash-info&peer_id=-UT2210-&port=users-port-95865786767695&uploaded=0&downloaded=0&left=0&corrupt=0&key=59845y9ty8945y88&event=started&numwant=200&compact=1&no_peer_id=1&ipv6=users-ip-address-here HTTP/1.1