diff --git a/mytv/nginx.conf b/mytv/nginx.conf index f7383f8..97eddb4 100644 --- a/mytv/nginx.conf +++ b/mytv/nginx.conf @@ -76,6 +76,12 @@ http { ~^(.*)(^|&)token=[^&]*&?(.*)$ $1$3; } + # 根据是否有参数构造跳转地址 + map $args_clean $redirect_uri { + "" $uri; # 没参数:只保留路径 + default $uri?$args_clean; # 有参数:加 ? + } + server { listen 20000; listen [::]:20000; @@ -122,7 +128,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn.16899.ggff.net; # 替换为您的源站地址 @@ -136,7 +142,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn.16899.ggff.net; # 替换为您的源站地址 @@ -191,7 +197,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://live.cdn.com.mp; # 替换为您的源站地址 @@ -205,7 +211,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://live.cdn.com.mp; # 替换为您的源站地址 @@ -260,7 +266,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://smt.1789.dpdns.org; # 替换为您的源站地址 @@ -274,7 +280,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_cache_valid 200 206 60s; # 缓存 60 秒 @@ -329,7 +335,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn6.16899.ggff.net; # 替换为您的源站地址 @@ -343,7 +349,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn6.16899.ggff.net; # 替换为您的源站地址 @@ -398,7 +404,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass http://v2h.1789.dpdns.org; # 替换为您的源站地址 @@ -412,7 +418,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass http://v2h.1789.dpdns.org; # 替换为您的源站地址 @@ -467,7 +473,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://live.tvfix.org; # 替换为您的源站地址 @@ -481,7 +487,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://live.tvfix.org; # 替换为您的源站地址 @@ -536,7 +542,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn5.zone.id; # 替换为您的源站地址 @@ -550,7 +556,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn5.zone.id; # 替换为您的源站地址 @@ -606,7 +612,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn2.16899.ggff.net; # 替换为您的源站地址 @@ -620,7 +626,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn2.16899.ggff.net; # 替换为您的源站地址 @@ -675,7 +681,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass http://aktv_stream.m16tv.cfd; # 替换为您的源站地址 @@ -689,7 +695,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass http://aktv_stream.m16tv.cfd; @@ -781,7 +787,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn8.zone.id; # 替换为您的源站地址 @@ -795,7 +801,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://cdn8.zone.id; # 替换为您的源站地址 @@ -849,7 +855,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://mytv.cdn.com.mp; # 替换为您的源站地址 @@ -864,7 +870,7 @@ http { if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $uri?$args_clean; + return 302 $redirect_uri; } proxy_pass https://hw.1678520.xyz/;