diff --git a/mytv/notoken/nginx.conf b/mytv/notoken/nginx.conf index 481ca35..eb57b05 100644 --- a/mytv/notoken/nginx.conf +++ b/mytv/notoken/nginx.conf @@ -66,22 +66,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -92,10 +92,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://cdn.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -117,22 +117,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 cdn3.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -143,10 +143,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://cdn3.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -168,22 +168,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 smt.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -194,20 +194,20 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://smt.veryfast.filegear-sg.me; # 替换为您的源站地址 } - # 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒 - location ~ smt2\.1\.5\.php { - proxy_cache_valid 200 206 60s; # 缓存 60 秒 - expires 60s; # 设置浏览器缓存 60 秒 - proxy_pass http://smt.veryfast.filegear-sg.me; - } + # 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒 + location ~ smt2\.1\.5\.php { + proxy_cache_valid 200 206 60s; # 缓存 60 秒 + expires 60s; # 设置浏览器缓存 60 秒 + proxy_pass http://smt.veryfast.filegear-sg.me; + } } server { @@ -219,22 +219,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -245,10 +245,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://cdn6.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -270,22 +270,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 v2h.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -296,10 +296,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://v2h.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -321,22 +321,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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.tvfix.org; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -347,10 +347,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass https://live.tvfix.org; # 替换为您的源站地址 } @@ -372,22 +372,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 o11.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -398,10 +398,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://o11.163189.xyz; # 替换为您的源站地址 } @@ -423,22 +423,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 cdn2.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -449,10 +449,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://cdn2.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -474,22 +474,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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 X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理 + proxy_set_header Host hls.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -500,53 +500,27 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { - 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 ""; } - # 针对 m3u8 文件内容修改 - location ~ \.m3u8$ { - proxy_pass http://s1.an94tv.cfd; - - # 替换为相对路径 - sub_filter 'http://s1.an94tv.cfd/AKTV/stream/' '/AKTV/stream/'; - 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)$ { - proxy_pass http://s1.an94tv.cfd; # 替换为您的源站地址 + # 针对 .jpg 和 .ts 和 .aac 文件的特殊缓存设置 + location ~* \.(jpg|ts|aac)$ { + proxy_pass https://hls.163189.xyz; # 替换为您的源站地址 proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒 expires 60s; # 设置浏览器端缓存 60 秒 } - - # 针对 m3u 文件内容修改 - location ~ \.m3u$ { - 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_once off; - sub_filter_types *; # 对所有 MIME 类型进行替换 - - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } } server { @@ -558,22 +532,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -584,10 +558,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://cdn8.veryfast.filegear-sg.me; # 替换为您的源站地址 } @@ -609,21 +583,21 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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; # 支持多级代理 - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -634,78 +608,78 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 3s; # 默认对 200 和 206 状态码缓存 3 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 3s; # 设置浏览器端缓存 3 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 3s; # 设置浏览器端缓存 3 秒 - # 默认 location 配置 + # 默认 location 配置 location / { proxy_pass http://mytv.veryfast.filegear-sg.me; # 替换为您的源站地址 proxy_set_header Host mytv.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 } - # /o12/ 子目录 - location /o12/ { - proxy_pass http://o12.veryfast.filegear-sg.me/; + # /o12/ 子目录 + location /o12/ { + proxy_pass http://o12.veryfast.filegear-sg.me/; proxy_set_header Host o12.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - } + } - # /cdn9/ 子目录 - location /cdn9/ { - proxy_pass http://cdn9.veryfast.filegear-sg.me/; + # /cdn9/ 子目录 + location /cdn9/ { + proxy_pass http://cdn9.veryfast.filegear-sg.me/; proxy_set_header Host cdn9.veryfast.filegear-sg.me; # 确保请求的 Host 匹配 Cloudflare 配置 - } + } - # /cdn11/ 子目录 - location /cdn11/ { - proxy_pass https://cdn11.163189.xyz/; - proxy_set_header Host cdn11.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 - sub_filter 'https://cdn11.163189.xyz' 'http://$host:20010/cdn11'; - sub_filter_once off; # 替换所有匹配项 - sub_filter_types application/vnd.apple.mpegurl text/plain; + # /cdn11/ 子目录 + location /cdn11/ { + proxy_pass https://cdn11.163189.xyz/; + proxy_set_header Host cdn11.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 + sub_filter 'https://cdn11.163189.xyz' 'http://$host:20010/cdn11'; + sub_filter_once off; # 替换所有匹配项 + sub_filter_types application/vnd.apple.mpegurl text/plain; - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } + # 解压 gzip 压缩内容(如源站启用了压缩) + gzip off; + proxy_set_header Accept-Encoding ""; + } - # /cdn12/ 子目录 - location /cdn12/ { - proxy_pass https://cdn12.178.indevs.in/; - proxy_set_header Host cdn12.178.indevs.in; # 确保请求的 Host 匹配 Cloudflare 配置 - sub_filter 'https://cdn12.178.indevs.in' 'http://$host:20010/cdn12'; - sub_filter_once off; # 替换所有匹配项 - sub_filter_types application/vnd.apple.mpegurl text/plain; + # /cdn12/ 子目录 + location /cdn12/ { + proxy_pass https://cdn12.178.indevs.in/; + proxy_set_header Host cdn12.178.indevs.in; # 确保请求的 Host 匹配 Cloudflare 配置 + sub_filter 'https://cdn12.178.indevs.in' 'http://$host:20010/cdn12'; + sub_filter_once off; # 替换所有匹配项 + sub_filter_types application/vnd.apple.mpegurl text/plain; - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } + # 解压 gzip 压缩内容(如源站启用了压缩) + gzip off; + proxy_set_header Accept-Encoding ""; + } - # /cdn13/ 子目录 - location /cdn13/ { - proxy_pass https://cdn13.178.indevs.in/; - proxy_set_header Host cdn13.178.indevs.in; # 确保请求的 Host 匹配 Cloudflare 配置 - sub_filter 'https://cdn13.178.indevs.in' 'http://$host:20010/cdn13'; - sub_filter_once off; # 替换所有匹配项 - sub_filter_types application/vnd.apple.mpegurl text/plain; + # /cdn13/ 子目录 + location /cdn13/ { + proxy_pass https://cdn13.178.indevs.in/; + proxy_set_header Host cdn13.178.indevs.in; # 确保请求的 Host 匹配 Cloudflare 配置 + sub_filter 'https://cdn13.178.indevs.in' 'http://$host:20010/cdn13'; + sub_filter_once off; # 替换所有匹配项 + sub_filter_types application/vnd.apple.mpegurl text/plain; - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } + # 解压 gzip 压缩内容(如源站启用了压缩) + gzip off; + proxy_set_header Accept-Encoding ""; + } - # /cdn15/ 子目录 - location /cdn15/ { - proxy_pass https://cdn15.163189.xyz/; - proxy_set_header Host cdn15.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 - sub_filter 'https://cdn15.163189.xyz' 'http://$host:20010/cdn15'; - sub_filter_once off; # 替换所有匹配项 - sub_filter_types application/vnd.apple.mpegurl text/plain; + # /cdn15/ 子目录 + location /cdn15/ { + proxy_pass https://cdn15.163189.xyz/; + proxy_set_header Host cdn15.163189.xyz; # 确保请求的 Host 匹配 Cloudflare 配置 + sub_filter 'https://cdn15.163189.xyz' 'http://$host:20010/cdn15'; + sub_filter_once off; # 替换所有匹配项 + sub_filter_types application/vnd.apple.mpegurl text/plain; - # 解压 gzip 压缩内容(如源站启用了压缩) - gzip off; - proxy_set_header Accept-Encoding ""; - } + # 解压 gzip 压缩内容(如源站启用了压缩) + gzip off; + proxy_set_header Accept-Encoding ""; + } } #stream-link反代配置 @@ -723,41 +697,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 = "") { @@ -765,51 +728,34 @@ 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; - } } @@ -822,22 +768,22 @@ http { add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-TTL $upstream_http_x_cache_ttl; - # 屏蔽 Cloudflare 响应头 - proxy_hide_header Server; - proxy_hide_header CF-Cache-Status; - proxy_hide_header CF-Ray; - proxy_hide_header Alt-Svc; - proxy_hide_header Expect-CT; - proxy_hide_header report-to; - proxy_hide_header Nel; - proxy_hide_header server-timing; + # 屏蔽 Cloudflare 响应头 + proxy_hide_header Server; + proxy_hide_header CF-Cache-Status; + proxy_hide_header CF-Ray; + proxy_hide_header Alt-Svc; + proxy_hide_header Expect-CT; + proxy_hide_header report-to; + proxy_hide_header Nel; + proxy_hide_header server-timing; - # 代理头设置 + # 代理头设置 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.veryfast.filegear-sg.me; - # SSL 配置 + # SSL 配置 proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议 proxy_ssl_ciphers HIGH:!aNULL:!MD5; # 设置加密套件 proxy_ssl_verify off; # 忽略上游服务器证书验证 @@ -848,10 +794,10 @@ http { proxy_cache_lock on; # 启用缓存锁 proxy_cache_valid 200 206 5s; # 默认对 200 和 206 状态码缓存 5 秒 proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求 - proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 - expires 5s; # 设置浏览器端缓存 5 秒 + proxy_ignore_headers Cache-Control Expires; # 忽略上游响应的缓存控制头 + expires 5s; # 设置浏览器端缓存 5 秒 - # 默认 location 配置 + # 默认 location 配置 location /mytv.m3u { proxy_pass http://cdn.veryfast.filegear-sg.me/mytv.m3u; # 替换为您的源站地址 sub_filter '服务器ip' '$host';