Update nginx.conf

This commit is contained in:
rad168
2025-06-01 06:00:08 +08:00
committed by GitHub
parent ed809521bf
commit 7511d71db1

View File

@@ -173,7 +173,7 @@ http {
# 代理头设置 # 代理头设置
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
proxy_set_header Host live.101.qzz.io; # 确保请求的 Host 匹配 Cloudflare 配置 proxy_set_header Host cdn3.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
# SSL 配置 # SSL 配置
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
@@ -200,7 +200,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://live.101.qzz.io; # 替换为您的源站地址 proxy_pass https://cdn3.163189.xyz; # 替换为您的源站地址
} }
# 针对 .ts 和 .aac 文件的特殊缓存设置 # 针对 .ts 和 .aac 文件的特殊缓存设置
@@ -214,7 +214,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://live.101.qzz.io; # 替换为您的源站地址 proxy_pass https://cdn3.163189.xyz; # 替换为您的源站地址
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
expires 60s; # 设置浏览器端缓存 60 秒 expires 60s; # 设置浏览器端缓存 60 秒
} }
@@ -518,7 +518,7 @@ http {
# 代理头设置 # 代理头设置
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
proxy_set_header Host cdn5.zone.id; # 确保请求的 Host 匹配 Cloudflare 配置 proxy_set_header Host cdn5.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
# SSL 配置 # SSL 配置
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
@@ -545,7 +545,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://cdn5.zone.id; # 替换为您的源站地址 proxy_pass https://cdn5.163189.xyz; # 替换为您的源站地址
} }
# 针对 .ts 和 .aac 文件的特殊缓存设置 # 针对 .ts 和 .aac 文件的特殊缓存设置
@@ -559,7 +559,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://cdn5.zone.id; # 替换为您的源站地址 proxy_pass https://cdn5.163189.xyz; # 替换为您的源站地址
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
expires 60s; # 设置浏览器端缓存 60 秒 expires 60s; # 设置浏览器端缓存 60 秒
} }
@@ -763,7 +763,7 @@ http {
# 代理头设置 # 代理头设置
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
proxy_set_header Host cdn8.zone.id; # 确保请求的 Host 匹配 Cloudflare 配置 proxy_set_header Host cdn8.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
# SSL 配置 # SSL 配置
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
@@ -790,7 +790,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://cdn8.zone.id; # 替换为您的源站地址 proxy_pass https://cdn8.163189.xyz; # 替换为您的源站地址
} }
# 针对 .ts 和 .aac 文件的特殊缓存设置 # 针对 .ts 和 .aac 文件的特殊缓存设置
@@ -804,7 +804,7 @@ http {
return 302 $redirect_uri; return 302 $redirect_uri;
} }
proxy_pass https://cdn8.zone.id; # 替换为您的源站地址 proxy_pass https://cdn8.163189.xyz; # 替换为您的源站地址
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
expires 60s; # 设置浏览器端缓存 60 秒 expires 60s; # 设置浏览器端缓存 60 秒
} }
@@ -891,6 +891,37 @@ http {
proxy_pass https://hw.1678520.xyz/; proxy_pass https://hw.1678520.xyz/;
proxy_set_header Host hw.1678520.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 proxy_set_header Host hw.1678520.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
} }
# /jxiptv/ 子目录
location /jxiptv/ {
if ($auth_ok = 0) {
return 302 https://cdn.1678520.xyz/403?mytv;
}
if ($arg_token) {
add_header Set-Cookie "token=$arg_token; Path=/";
return 302 $redirect_uri;
}
proxy_pass http://jxiptv.dpdns.org/;
proxy_set_header Host jxiptv.dpdns.org; # 确保请求的 Host 匹配 Cloudflare 配置
}
# /huya/ 子目录
location /huya/ {
if ($auth_ok = 0) {
return 302 https://cdn.1678520.xyz/403?mytv;
}
if ($arg_token) {
add_header Set-Cookie "token=$arg_token; Path=/";
return 302 $redirect_uri;
}
proxy_pass http://huya.jxiptv.dpdns.org/;
proxy_set_header Host huya.jxiptv.dpdns.org; # 确保请求的 Host 匹配 Cloudflare 配置
}
} }
server { server {
@@ -941,10 +972,11 @@ http {
add_header Set-Cookie "token=$arg_token; Path=/"; add_header Set-Cookie "token=$arg_token; Path=/";
} }
proxy_pass https://cdn.16899.ggff.net/mytv.m3u; # 替换为您的源站地址 proxy_pass https://cdn5.163189.xyz/mytv.m3u; # 替换为您的源站地址
sub_filter '服务器ip' '$host'; sub_filter '服务器ip' '$host';
sub_filter '.m3u8' '.m3u8?token=$arg_token'; sub_filter '.m3u8' '.m3u8?token=$arg_token';
sub_filter 'smtm3u8' 'smtm3u8&token=$arg_token'; sub_filter 'smt3.2.1.php?' 'smt3.2.1.php?token=$arg_token&';
sub_filter '?u=test' '&u=test';
sub_filter_once off; # 替换所有匹配项 sub_filter_once off; # 替换所有匹配项
sub_filter_types *; # 对所有 MIME 类型进行替换 sub_filter_types *; # 对所有 MIME 类型进行替换