小樱 发表于 2019/4/11 04:14

kangle用url_rewrite重写模块,实现CDN上反代回源真实服务器过程之前,实现302跳转替换peer_id请求参数,NexusPHP测试支持pt

kangle用url_rewrite重写模块,实现CDN上反代回源真实服务器过程之前,实现302跳转替换peer_id请求参数,NexusPHP测试支持pt

需求,替换peer_id中请求参数


实现图,利用302更换请求地址


^(.*)BC0156(.*)$
$1UT354S$2

测试请求
https://hdhome.org/announce.php?passkey=71441fd7573649394b8812d09f4e9f07&info_hash=%C4%AA%A4%DD%CD%F2%10%28%3A%1F%E8%D0%1D6%C0%A4%E5%87%90%17&peer_id=-BC0156-%16%7FW%8C%E2l%DB%5B%A2%E8y%8E&port=22223&natmapped=1&localip=192.168.1.2&port_type=lan&uploaded=0&downloaded=0&left=17632739&numwant=200&compact=1&no_peer_id=1&key=41336

源站服务器收到效果
https://hdhome.org/announce.php?passkey=71441fd7573649394b8812d09f4e9f07&info_hash=%C4%AA%A4%DD%CD%F2%10%28%3A%1F%E8%D0%1D6%C0%A4%E5%87%90%17&peer_id=-UT354S-%16%7FW%8C%E2l%DB%5B%A2%E8y%8E&port=22223&natmapped=1&localip=192.168.1.2&port_type=lan&uploaded=0&downloaded=0&left=17632739&numwant=200&compact=1&no_peer_id=1&key=41336

页: [1]
查看完整版本: kangle用url_rewrite重写模块,实现CDN上反代回源真实服务器过程之前,实现302跳转替换peer_id请求参数,NexusPHP测试支持pt