diff --git a/mytv/alpine/nginx.conf b/mytv/alpine/nginx.conf index d7f716a..10f74f0 100644 --- a/mytv/alpine/nginx.conf +++ b/mytv/alpine/nginx.conf @@ -66,7 +66,7 @@ http { # 反代设置 server { listen 20000; - listen [::]:20000; + listen [::]:20000; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -79,59 +79,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { - return 302 https://cdn5.163189.xyz/403/?mytv; - } + if ($auth_ok = 0) { + return 302 https://cdn5.163189.xyz/403/?mytv; + } - if ($arg_token) { - add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; - } + if ($arg_token) { + add_header Set-Cookie "token=$arg_token; Path=/"; + return 302 $redirect_uri; + } proxy_pass http://cdn.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -139,7 +139,7 @@ http { # 反代设置:第二个网站 server { listen 20001; - listen [::]:20001; + listen [::]:20001; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -152,59 +152,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn3.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn3.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn3.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn3.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -212,7 +212,7 @@ http { # 反代设置:第三个网站 server { listen 20002; - listen [::]:20002; + listen [::]:20002; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -225,59 +225,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host smt.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host smt.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://smt.veryfast.filegear-sg.me; } - # 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒 + # 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒 location ~ smt2\.1\.5\.php { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://smt.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -285,7 +285,7 @@ http { # 反代设置:第四个网站 server { listen 20003; - listen [::]:20003; + listen [::]:20003; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -298,59 +298,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn6.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn6.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn6.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn6.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -358,7 +358,7 @@ http { # 反代设置:第五个网站 server { listen 20004; - listen [::]:20004; + listen [::]:20004; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -371,59 +371,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host v2h.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host v2h.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://v2h.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } - proxy_pass http://v2h.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_pass http://v2h.veryfast.filegear-sg.me; # 替换为您的源站地址 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -431,7 +431,7 @@ http { # 反代设置:第六个网站 server { listen 20005; - listen [::]:20005; + listen [::]:20005; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -444,59 +444,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host live.tvfix.org; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host live.tvfix.org; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass https://live.tvfix.org; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|webvtt|key)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass https://live.tvfix.org; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -504,7 +504,7 @@ http { # 反代设置:第七个网站 server { listen 20006; - listen [::]:20006; + listen [::]:20006; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -517,59 +517,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host o11.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host o11.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://o11.163189.xyz; } - # 针对 .jpg 和 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .jpg 和 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(jpg|ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://o11.163189.xyz; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -577,7 +577,7 @@ http { # 反代设置:第八个网站 server { listen 20007; - listen [::]:20007; + listen [::]:20007; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -590,59 +590,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn2.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn2.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn2.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn2.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -650,7 +650,7 @@ http { # 反代设置:第九个网站 server { listen 20008; - listen [::]:20008; + listen [::]:20008; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -663,95 +663,74 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host s1.an94tv.cfd; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host hls.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } - proxy_pass http://s1.an94tv.cfd; + proxy_pass https://hls.163189.xyz; + sub_filter 'https://hls.163189.xyz/' '/'; + sub_filter_once off; # 替换所有匹配项 + sub_filter_types application/vnd.apple.mpegurl text/plain; + + # 解压 gzip 压缩内容(如源站启用了压缩) + gzip off; + proxy_set_header Accept-Encoding ""; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 - location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + # 针对 .jpg 和 .ts 和 .aac 文件的特殊缓存设置 + location ~* \.(jpg|ts|aac)$ { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } - proxy_pass http://s1.an94tv.cfd; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_pass https://hls.163189.xyz; # 替换为您的源站地址 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } - - # 针对 m3u 文件内容修改 - location ~ \.m3u$ { - if ($auth_ok = 0) { - return 302 https://cdn5.163189.xyz/403/?mytv; - } - - if ($arg_token) { - set $cookie_token "token=$arg_token; Path=/"; - } - - proxy_pass http://aktv.space; - - # 强制标记为纯文本 - default_type text/plain; - add_header Content-Type "text/plain; charset=utf-8" always; - add_header Content-Disposition "inline" always; - - # 替换为相对路径 - sub_filter 'http://s1.an94tv.cfd' 'http://$host:20008'; - sub_filter 'AKTV.m3u8' 'AKTV.m3u8?token=$arg_token'; - sub_filter_once off; - sub_filter_types *; # 对所有 MIME 类型进行替换 - - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } } # 反代设置:第十个网站 server { listen 20009; - listen [::]:20009; + listen [::]:20009; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -764,59 +743,59 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn8.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn8.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn8.veryfast.filegear-sg.me; } - # 针对 .ts 和 .aac 文件的特殊缓存设置 + # 针对 .ts 和 .aac 文件的特殊缓存设置 location ~* \.(ts|aac)$ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn8.veryfast.filegear-sg.me; # 替换为您的源站地址 - proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 - expires 60s; # 设置浏览器端缓存 60 秒 + proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 + expires 60s; # 设置浏览器端缓存 60 秒 } } @@ -824,7 +803,7 @@ http { # 反代设置:第十一个网站 server { listen 20010; - listen [::]:20010; + listen [::]:20010; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -837,73 +816,73 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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; # 支持多级代理 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置(未设置ts文件缓存) - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + # 默认缓存配置(未设置ts文件缓存) + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 # 默认 location 配置 location / { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://mytv.veryfast.filegear-sg.me; - proxy_set_header Host mytv.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host mytv.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 } # /o12/ 子目录 location /o12/ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://o12.veryfast.filegear-sg.me/; - proxy_set_header Host o12.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host o12.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 } # /cdn9/ 子目录 location /cdn9/ { - if ($auth_ok = 0) { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } if ($arg_token) { add_header Set-Cookie "token=$arg_token; Path=/"; - return 302 $redirect_uri; + return 302 $redirect_uri; } proxy_pass http://cdn9.veryfast.filegear-sg.me/; - proxy_set_header Host cdn9.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn9.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 } # /cdn11/ 子目录 @@ -1010,41 +989,30 @@ http { proxy_buffering off; proxy_request_buffering off; chunked_transfer_encoding on; - proxy_set_header User-Agent "TiviMate/5.1.0"; proxy_set_header Accept "*/*"; proxy_set_header Connection "keep-alive"; # ================== m3u订阅文件 ================== location ~ \.m3u$ { - proxy_pass https://www.stream-link.org; - proxy_set_header Host www.stream-link.org; proxy_set_header User-Agent "TiviMate/5.1.0"; - sub_filter_once off; sub_filter_types *; - sub_filter 'https://' 'http://$host:30001/p/https://'; - gzip off; - proxy_set_header Accept-Encoding ""; } # ================== 核心 /p/ 动态反代 ================== location ^~ /p/ { - resolver 1.1.1.1 ipv6=off; - set $target $request_uri; if ($target ~ "^/p/(https?://[^/]+)(/.*)$") { - set $upstream_host $1; set $upstream_path $2; - } if ($upstream_host = "") { @@ -1052,58 +1020,43 @@ http { } proxy_pass $upstream_host$upstream_path; - proxy_set_header Host $proxy_host; proxy_set_header User-Agent "TiviMate/5.1.0"; - proxy_ssl_server_name on; - proxy_set_header Referer https://www.stream-link.org/; - gzip off; - proxy_set_header Accept-Encoding ""; - sub_filter_once off; sub_filter_types application/vnd.apple.mpegurl text/plain; - sub_filter '/2600_' 'http://$host:30001/p/$upstream_host/2600_'; sub_filter '/hls_' 'http://$host:30001/p/$upstream_host/hls_'; sub_filter 'https://' 'http://$host:30001/p/https://'; - proxy_intercept_errors on; - error_page 301 302 307 = @redirect; } # ================== 内部跳转处理 ================== location @redirect { - set $redirect_url $upstream_http_location; if ($redirect_url ~ "^/") { - set $redirect_url https://$proxy_host$redirect_url; - } set $redirect_url /p/$redirect_url; - return 302 $redirect_url; } # ================== 默认拒绝其他请求 ================== location / { - return 404; - } } # 反代设置:订阅链接 server { listen 30000; - listen [::]:30000; + listen [::]:30000; server_name cdn5.163189.xyz; # 屏蔽 Cloudflare 响应头 @@ -1116,33 +1069,33 @@ http { proxy_hide_header Nel; proxy_hide_header server-timing; - # 自定义响应头:缓存命中状态和剩余缓存时间 - add_header X-Cache-Status $upstream_cache_status; - add_header X-Cache-TTL $upstream_http_x_cache_ttl; - add_header X-Cache-Key $scheme$host$request_uri; + # 自定义响应头:缓存命中状态和剩余缓存时间 + add_header X-Cache-Status $upstream_cache_status; + add_header X-Cache-TTL $upstream_http_x_cache_ttl; + add_header X-Cache-Key $scheme$host$request_uri; # 代理头设置 - 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 Host cdn.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 + proxy_set_header Host cdn.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 # SSL 配置 - proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 - proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 - proxy_ssl_verify off; # 忽略上游服务器证书验证 - proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 + proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 + proxy_ssl_verify off; # 忽略上游服务器证书验证 + proxy_ssl_server_name on; - # 默认缓存配置 - proxy_cache my_cache; # 使用指定的缓存区域 - proxy_cache_lock on; # 启用缓存锁 - proxy_cache_key "$scheme$host$request_uri"; #缓存 Key - proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 + # 默认缓存配置 + proxy_cache my_cache; # 使用指定的缓存区域 + proxy_cache_lock on; # 启用缓存锁 + proxy_cache_key "$scheme$host$request_uri"; #缓存 Key + proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 - location /mytv.m3u { - if ($auth_ok = 0) { + # 默认 location 配置 + location /mytv.m3u { + if ($auth_ok = 0) { return 302 https://cdn5.163189.xyz/403/?mytv; } @@ -1150,16 +1103,16 @@ http { add_header Set-Cookie "token=$arg_token; Path=/"; } - proxy_pass http://cdn.veryfast.filegear-sg.me/mytv.m3u; # 替换为您的源站地址 + proxy_pass http://cdn.veryfast.filegear-sg.me/mytv.m3u; # 替换为您的源站地址 sub_filter '服务器ip' '$host'; - sub_filter '.m3u8' '.m3u8?token=$arg_token'; + sub_filter '.m3u8' '.m3u8?token=$arg_token'; sub_filter 'smt3.2.1.php?' 'smt3.2.1.php?token=$arg_token&'; sub_filter '?u=test' '&u=test'; sub_filter '?163189' '?163189&token=$arg_token'; sub_filter_once off; # 替换所有匹配项 - sub_filter_types *; # 对所有 MIME 类型进行替换 + sub_filter_types *; # 对所有 MIME 类型进行替换 - # 解压 gzip 压缩内容(如源站启用了压缩) + # 解压 gzip 压缩内容(如源站启用了压缩) gzip off; proxy_set_header Accept-Encoding "";