mirror of
https://github.com/rad168/iptv.git
synced 2025-12-17 15:25:00 +08:00
Update nginx.conf
This commit is contained in:
@@ -76,7 +76,7 @@ http {
|
||||
# 代理头设置
|
||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||
proxy_set_header Host cdn.163.dedyn.io; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
proxy_set_header Host cdn.16899.ggff.net; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
|
||||
# SSL 配置
|
||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||
@@ -95,28 +95,28 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://cdn.163.dedyn.io;
|
||||
proxy_pass https://cdn.16899.ggff.net;
|
||||
|
||||
}
|
||||
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://cdn.163.dedyn.io; # 替换为您的源站地址
|
||||
proxy_pass https://cdn.16899.ggff.net; # 替换为您的源站地址
|
||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||
expires 60s; # 设置浏览器端缓存 60 秒
|
||||
|
||||
@@ -166,7 +166,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -180,7 +180,7 @@ http {
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -237,7 +237,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -251,7 +251,7 @@ http {
|
||||
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
||||
location ~ smt2\.1\.5\.php {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -289,7 +289,7 @@ http {
|
||||
# 代理头设置
|
||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||
proxy_set_header Host cdn6.0o0.myfw.us; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
proxy_set_header Host cdn6.16899.ggff.net; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
|
||||
# SSL 配置
|
||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||
@@ -308,28 +308,28 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://cdn6.0o0.myfw.us;
|
||||
proxy_pass https://cdn6.16899.ggff.net;
|
||||
|
||||
}
|
||||
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://cdn6.0o0.myfw.us; # 替换为您的源站地址
|
||||
proxy_pass https://cdn6.16899.ggff.net; # 替换为您的源站地址
|
||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||
expires 60s; # 设置浏览器端缓存 60 秒
|
||||
|
||||
@@ -379,7 +379,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -393,7 +393,7 @@ http {
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -450,7 +450,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -464,7 +464,7 @@ http {
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -502,7 +502,7 @@ http {
|
||||
# 代理头设置
|
||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||
proxy_set_header Host tv.cdn.com.mp; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
proxy_set_header Host cdn2.16899.ggff.net; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
|
||||
# SSL 配置
|
||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||
@@ -521,28 +521,28 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://tv.cdn.com.mp;
|
||||
proxy_pass https://cdn2.16899.ggff.net;
|
||||
|
||||
}
|
||||
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://tv.cdn.com.mp; # 替换为您的源站地址
|
||||
proxy_pass https://cdn2.16899.ggff.net; # 替换为您的源站地址
|
||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||
expires 60s; # 设置浏览器端缓存 60 秒
|
||||
|
||||
@@ -592,7 +592,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -606,7 +606,7 @@ http {
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -622,7 +622,7 @@ http {
|
||||
# 针对 m3u 文件内容修改
|
||||
location ~ \.m3u$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -686,7 +686,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -700,7 +700,7 @@ http {
|
||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||
location ~* \.(ts|aac)$ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -756,7 +756,7 @@ http {
|
||||
# 默认 location 配置
|
||||
location / {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -771,7 +771,7 @@ http {
|
||||
# /hw/ 子目录
|
||||
location /hw/ {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
@@ -807,7 +807,7 @@ http {
|
||||
# 代理头设置
|
||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||
proxy_set_header Host raw.githubusercontent.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
proxy_set_header Host cdn.16899.ggff.net; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||
|
||||
# SSL 配置
|
||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||
@@ -826,14 +826,14 @@ http {
|
||||
# 默认 location 配置
|
||||
location /mytv.m3u {
|
||||
if ($auth_ok = 0) {
|
||||
return 302 https://cdn.163189.xyz/403?mytv;
|
||||
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||
}
|
||||
|
||||
if ($arg_token) {
|
||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||
}
|
||||
|
||||
proxy_pass https://cdn.163.dedyn.io/mytv.m3u; # 替换为您的源站地址
|
||||
proxy_pass https://cdn.16899.ggff.net/mytv.m3u; # 替换为您的源站地址
|
||||
sub_filter '服务器ip' '$host';
|
||||
sub_filter '.m3u8' '.m3u8?token=$arg_token';
|
||||
sub_filter 'smtm3u8' 'smtm3u8&token=$arg_token';
|
||||
|
||||
Reference in New Issue
Block a user