mirror of
https://github.com/rad168/iptv.git
synced 2025-12-17 23:34:38 +08:00
Update nginx.conf
This commit is contained in:
@@ -82,7 +82,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 cdn.163.dedyn.io; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host cdn.16899.ggff.net; # 确保请求的 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 协议
|
||||||
@@ -101,27 +101,27 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass https://cdn.163.dedyn.io; # 替换为您的源站地址
|
proxy_pass https://cdn.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
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 秒
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -171,7 +171,7 @@ http {
|
|||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -215,7 +215,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -228,7 +228,7 @@ http {
|
|||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -243,7 +243,7 @@ http {
|
|||||||
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
||||||
location ~ smt2\.1\.5\.php {
|
location ~ smt2\.1\.5\.php {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -268,7 +268,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 cdn6.0o0.myfw.us; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host cdn6.16899.ggff.net; # 确保请求的 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 协议
|
||||||
@@ -287,27 +287,27 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass https://cdn6.0o0.myfw.us; # 替换为您的源站地址
|
proxy_pass https://cdn6.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
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 秒
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
@@ -344,7 +344,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -357,7 +357,7 @@ http {
|
|||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -401,7 +401,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -414,7 +414,7 @@ http {
|
|||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -439,7 +439,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 tv.cdn.com.mp; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host cdn2.16899.ggff.net; # 确保请求的 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 协议
|
||||||
@@ -459,27 +459,27 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
|
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
add_header Set-Cookie "token=$arg_token; Path=/";
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass https://tv.cdn.com.mp; # 替换为您的源站地址
|
proxy_pass https://cdn2.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
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 秒
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
@@ -516,7 +516,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -529,7 +529,7 @@ http {
|
|||||||
# 针对 m3u8 文件内容修改
|
# 针对 m3u8 文件内容修改
|
||||||
location ~ \.m3u8$ {
|
location ~ \.m3u8$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -558,7 +558,7 @@ http {
|
|||||||
# 针对 m3u 文件内容修改
|
# 针对 m3u 文件内容修改
|
||||||
location ~ \.m3u$ {
|
location ~ \.m3u$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -610,7 +610,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -623,7 +623,7 @@ http {
|
|||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -666,7 +666,7 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -680,7 +680,7 @@ http {
|
|||||||
# /hw/ 子目录
|
# /hw/ 子目录
|
||||||
location /hw/ {
|
location /hw/ {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
@@ -704,7 +704,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 raw.githubusercontent.com;
|
proxy_set_header Host cdn.16899.ggff.net;
|
||||||
|
|
||||||
# SSL 配置
|
# SSL 配置
|
||||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||||
@@ -723,14 +723,14 @@ http {
|
|||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location /mytv.m3u {
|
location /mytv.m3u {
|
||||||
if ($auth_ok = 0) {
|
if ($auth_ok = 0) {
|
||||||
return 302 https://cdn.163189.xyz/403?mytv;
|
return 302 https://cdn.1678520.xyz/403?mytv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arg_token) {
|
if ($arg_token) {
|
||||||
add_header Set-Cookie "token=$arg_token; Path=/";
|
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 '服务器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 'smtm3u8' 'smtm3u8&token=$arg_token';
|
||||||
|
|||||||
Reference in New Issue
Block a user