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:
@@ -66,10 +66,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 协议
|
||||||
@@ -87,12 +97,12 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://cdn.163.dedyn.io; # 替换为您的源站地址
|
proxy_pass https://cdn.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
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 秒
|
||||||
}
|
}
|
||||||
@@ -107,10 +117,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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.cdn.com.mp; # 确保请求的 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 协议
|
||||||
@@ -128,12 +148,12 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://live.cdn.com.mp; # 替换为您的源站地址
|
proxy_pass https://cdn3.163189.xyz; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
proxy_pass https://live.cdn.com.mp; # 替换为您的源站地址
|
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 秒
|
||||||
}
|
}
|
||||||
@@ -148,10 +168,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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.zone.id; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host smt.1789.dpdns.org; # 确保请求的 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 协议
|
||||||
@@ -169,21 +199,14 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://cdn6.zone.id; # 替换为您的源站地址
|
proxy_pass https://smt.1789.dpdns.org; # 替换为您的源站地址
|
||||||
}
|
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn6.zone.id; # 替换为您的源站地址
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
||||||
location ~ smt2\.1\.5\.php {
|
location ~ smt2\.1\.5\.php {
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 60 秒
|
proxy_cache_valid 200 206 60s; # 缓存 60 秒
|
||||||
expires 60s; # 设置浏览器缓存 60 秒
|
expires 60s; # 设置浏览器缓存 60 秒
|
||||||
proxy_pass https://cdn6.zone.id;
|
proxy_pass https://smt.1789.dpdns.org;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,10 +219,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 协议
|
||||||
@@ -217,12 +250,12 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://cdn6.0o0.myfw.us; # 替换为您的源站地址
|
proxy_pass https://cdn6.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
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 秒
|
||||||
}
|
}
|
||||||
@@ -237,6 +270,16 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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; # 支持多级代理
|
||||||
@@ -270,18 +313,28 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 20006;
|
listen 20005;
|
||||||
listen [::]:20006;
|
listen [::]:20005;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 live.tvfix.org; # 确保请求的 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 协议
|
||||||
@@ -299,12 +352,63 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://cdn5.zone.id; # 替换为您的源站地址
|
proxy_pass https://live.tvfix.org; # 替换为您的源站地址
|
||||||
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|webvtt|key)$ {
|
||||||
|
proxy_pass https://live.tvfix.org; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 20006;
|
||||||
|
listen [::]:20006;
|
||||||
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
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;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||||
|
proxy_set_header Host cdn5.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_cache cache_zone; # 使用指定的缓存区域
|
||||||
|
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 秒
|
||||||
|
|
||||||
|
# 默认 location 配置
|
||||||
|
location / {
|
||||||
|
proxy_pass https://cdn5.163189.xyz; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
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 秒
|
||||||
}
|
}
|
||||||
@@ -319,10 +423,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 协议
|
||||||
@@ -340,12 +454,12 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://tv.cdn.com.mp; # 替换为您的源站地址
|
proxy_pass https://cdn2.16899.ggff.net; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
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 秒
|
||||||
}
|
}
|
||||||
@@ -360,6 +474,16 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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; # 支持多级代理
|
||||||
@@ -411,6 +535,7 @@ http {
|
|||||||
|
|
||||||
# 替换为相对路径
|
# 替换为相对路径
|
||||||
sub_filter 'http://aktv_stream.m16tv.cfd' 'http://$host:20008';
|
sub_filter 'http://aktv_stream.m16tv.cfd' 'http://$host:20008';
|
||||||
|
sub_filter 'AKTV.m3u8' 'AKTV.m3u8?token=$arg_token';
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
sub_filter_types application/vnd.apple.mpegurl text/plain;
|
sub_filter_types application/vnd.apple.mpegurl text/plain;
|
||||||
|
|
||||||
@@ -429,10 +554,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 协议
|
||||||
@@ -450,12 +585,12 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://cdn8.zone.id; # 替换为您的源站地址
|
proxy_pass https://cdn8.163189.xyz; # 替换为您的源站地址
|
||||||
}
|
}
|
||||||
|
|
||||||
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
location ~* \.(ts|aac)$ {
|
location ~* \.(ts|aac)$ {
|
||||||
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 秒
|
||||||
}
|
}
|
||||||
@@ -470,6 +605,16 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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; # 支持多级代理
|
||||||
@@ -490,15 +635,16 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location / {
|
location / {
|
||||||
proxy_pass https://mytv.cdn.com.mp; # 替换为您的源站地址
|
proxy_pass https://mytv.101.qzz.io; # 替换为您的源站地址
|
||||||
proxy_set_header Host mytv.cdn.com.mp; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host mytv.101.qzz.io; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||||
}
|
}
|
||||||
|
|
||||||
# /hw/ 子目录
|
# /o12/ 子目录
|
||||||
location /hw/ {
|
location /o12/ {
|
||||||
proxy_pass https://hw.1678520.xyz/;
|
proxy_pass https://o12.1678520.xyz/;
|
||||||
proxy_set_header Host hw.1678520.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
|
proxy_set_header Host o12.1678520.xyz; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -510,10 +656,20 @@ http {
|
|||||||
add_header X-Cache-Status $upstream_cache_status;
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
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;
|
||||||
|
|
||||||
# 代理头设置
|
# 代理头设置
|
||||||
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 cdn5.163189.xyz;
|
||||||
|
|
||||||
# SSL 配置
|
# SSL 配置
|
||||||
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 指定 SSL 协议
|
||||||
@@ -531,7 +687,7 @@ http {
|
|||||||
|
|
||||||
# 默认 location 配置
|
# 默认 location 配置
|
||||||
location /mytv.m3u {
|
location /mytv.m3u {
|
||||||
proxy_pass https://raw.githubusercontent.com/rad168/iptv/refs/heads/main/mytv.m3u; # 替换为您的源站地址
|
proxy_pass https://cdn5.163189.xyz/mytv.m3u; # 替换为您的源站地址
|
||||||
sub_filter '服务器ip' '$host';
|
sub_filter '服务器ip' '$host';
|
||||||
sub_filter_once off; # 替换所有匹配项
|
sub_filter_once off; # 替换所有匹配项
|
||||||
sub_filter_types *; # 对所有 MIME 类型进行替换
|
sub_filter_types *; # 对所有 MIME 类型进行替换
|
||||||
@@ -539,7 +695,6 @@ http {
|
|||||||
# 解压 gzip 压缩内容(如源站启用了压缩)
|
# 解压 gzip 压缩内容(如源站启用了压缩)
|
||||||
gzip off;
|
gzip off;
|
||||||
proxy_set_header Accept-Encoding "";
|
proxy_set_header Accept-Encoding "";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user