mirror of
https://github.com/rad168/iptv.git
synced 2025-12-21 01:04:49 +08:00
Update nginx.conf
This commit is contained in:
639
mytv/nginx.conf
639
mytv/nginx.conf
@@ -54,59 +54,53 @@ http {
|
|||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
include /etc/nginx/sites-enabled/*;
|
include /etc/nginx/sites-enabled/*;
|
||||||
|
|
||||||
|
# 定义一个 map,用来检查查询字符串或路径中是否包含 .ts 或 .aac
|
||||||
|
map $uri $is_media {
|
||||||
|
default 0;
|
||||||
|
~*\.ts$ 1; # 匹配路径中的 .ts 文件
|
||||||
|
~*\.aac$ 1; # 匹配路径中的 .aac 文件
|
||||||
|
~*ts=[^&]+\.ts$ 1; # 匹配查询字符串中的 ts 参数
|
||||||
|
~*aac=[^&]+\.aac$ 1; # 匹配查询字符串中的 aac 参数
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 20000;
|
listen 20000;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.132.us.kg; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://cdn.132.us.kg; # 替换为您的源站地址
|
proxy_pass https://cdn.132.us.kg; # 替换为您的源站地址
|
||||||
proxy_set_header Host cdn.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host cdn.132.us.kg;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn.132.us.kg; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host cdn.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host cdn.132.us.kg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://cdn.1689.us.kg; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,55 +108,40 @@ http {
|
|||||||
listen 20001;
|
listen 20001;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.132.us.kg; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://cdn3.132.us.kg; # 替换为您的源站地址
|
proxy_pass https://cdn3.132.us.kg; # 替换为您的源站地址
|
||||||
proxy_set_header Host cdn3.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host cdn3.132.us.kg;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn3.132.us.kg; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host cdn3.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host cdn3.132.us.kg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://cdn3.132.us.kg; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,111 +149,88 @@ http {
|
|||||||
listen 20002;
|
listen 20002;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.1689.us.kg; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://cdn.1689.us.kg; # 替换为您的源站地址
|
proxy_pass https://cdn.1689.us.kg; # 替换为您的源站地址
|
||||||
proxy_set_header Host cdn.1689.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用指定的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 10s; # 默认对 200 和 206 状态码缓存 5 秒
|
|
||||||
proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
expires 10s; # 设置浏览器端缓存 5 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host cdn.1689.us.kg;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn.1689.us.kg; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host cdn.1689.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host cdn.1689.us.kg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://cdn.1689.us.kg; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对包含 smt2.1.5.php 的 URL,设置缓存时间为 60 秒
|
||||||
|
location ~ smt2\.1\.5\.php {
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 60 秒
|
||||||
|
expires 60s; # 设置浏览器缓存 60 秒
|
||||||
|
proxy_pass https://cdn.1689.us.kg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 20003;
|
listen 20003;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.jdshipin.com; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://v2h.jdshipin.com; # 替换为您的源站地址
|
proxy_pass https://v2h.jdshipin.com; # 替换为您的源站地址
|
||||||
proxy_set_header Host v2h.jdshipin.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用指定的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 10s; # 默认对 200 和 206 状态码缓存 10 秒
|
|
||||||
proxy_cache_methods GET HEAD; # 仅缓存 GET 和 HEAD 请求
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
expires 10s; # 设置浏览器端缓存 10 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host v2h.jdshipin.com;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://v2h.jdshipin.com; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host v2h.jdshipin.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host v2h.jdshipin.com;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://v2h.jdshipin.com; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,55 +238,40 @@ http {
|
|||||||
listen 20004;
|
listen 20004;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
||||||
|
proxy_set_header Host v2hcdn.jdshipin.com; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://v2hcdn.jdshipin.com; # 替换为您的源站地址
|
proxy_pass https://v2hcdn.jdshipin.com; # 替换为您的源站地址
|
||||||
proxy_set_header Host v2hcdn.jdshipin.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host v2hcdn.jdshipin.com;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://v2hcdn.jdshipin.com; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host v2hcdn.jdshipin.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host v2hcdn.jdshipin.com;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://v2hcdn.jdshipin.com; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,58 +279,44 @@ http {
|
|||||||
listen 20005;
|
listen 20005;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 固定请求头
|
||||||
|
proxy_set_header User-Agent "TiviMate/5.1.0";
|
||||||
|
proxy_set_header Referer "https://edge3.hkdvb.com/";
|
||||||
|
proxy_set_header Host edge3.hkdvb.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
#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_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 / {
|
location / {
|
||||||
proxy_pass https://edge3.hkdvb.com; # 替换为您的源站地址
|
proxy_pass https://edge3.hkdvb.com; # 替换为您的源站地址
|
||||||
proxy_set_header Host edge3.hkdvb.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
# 固定请求头
|
|
||||||
proxy_set_header Host edge3.hkdvb.com;
|
|
||||||
proxy_set_header X-Real-IP 127.0.0.1;
|
|
||||||
proxy_set_header X-Forwarded-For 127.0.0.1;
|
|
||||||
proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 OPR/114.0.0.0 (Edition GX-CN)";
|
|
||||||
proxy_set_header Referer "https://edge3.hkdvb.com/";
|
|
||||||
|
|
||||||
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_set_header Host edge3.hkdvb.com;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://edge3.hkdvb.com; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host edge3.hkdvb.com; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host edge3.hkdvb.com;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://edge3.hkdvb.com; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,55 +324,40 @@ http {
|
|||||||
listen 20006;
|
listen 20006;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.1689.us.kg; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://cdn5.1689.us.kg; # 替换为您的源站地址
|
proxy_pass https://cdn5.1689.us.kg; # 替换为您的源站地址
|
||||||
proxy_set_header Host cdn5.1689.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host cdn5.1689.us.kg;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn5.1689.us.kg; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host cdn5.1689.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host cdn5.1689.us.kg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://cdn5.1689.us.kg; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,55 +365,40 @@ http {
|
|||||||
listen 20007;
|
listen 20007;
|
||||||
server_name cdn.1678520.xyz; # 替换为您的域名
|
server_name cdn.1678520.xyz; # 替换为您的域名
|
||||||
|
|
||||||
|
# 自定义响应头:缓存命中状态和剩余缓存时间
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
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.132.us.kg; # 确保请求的 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 / {
|
location / {
|
||||||
proxy_pass https://cdn2.132.us.kg; # 替换为您的源站地址
|
proxy_pass https://cdn2.132.us.kg; # 替换为您的源站地址
|
||||||
proxy_set_header Host cdn2.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
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 秒
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实 IP
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 支持多级代理
|
|
||||||
proxy_set_header Host $host; # 保留原始主机头
|
|
||||||
|
|
||||||
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_set_header Host cdn2.132.us.kg;
|
|
||||||
|
|
||||||
|
|
||||||
# 针对 .ts 等文件的特殊缓存设置
|
|
||||||
location ~* \.(ts|aac)$ {
|
|
||||||
proxy_pass https://cdn2.132.us.kg; # 替换为您的源站地址
|
|
||||||
proxy_set_header Host cdn2.132.us.kg; # 确保请求的 Host 匹配 Cloudflare 配置
|
|
||||||
proxy_cache cache_zone; # 使用相同的缓存区域
|
|
||||||
proxy_cache_lock on; # 启用缓存锁
|
|
||||||
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
|
||||||
proxy_cache_methods GET HEAD;
|
|
||||||
proxy_ignore_headers Cache-Control Expires;
|
|
||||||
|
|
||||||
# 自定义响应头:缓存命中状态和剩余缓存时间
|
|
||||||
add_header X-Cache-Status $upstream_cache_status;
|
|
||||||
add_header X-Cache-TTL $upstream_http_x_cache_ttl;
|
|
||||||
|
|
||||||
expires 60s; # 设置浏览器端缓存 60 秒
|
|
||||||
|
|
||||||
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_set_header Host cdn2.132.us.kg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 针对 .ts 和 .aac 文件的特殊缓存设置
|
||||||
|
location ~* \.(ts|aac)$ {
|
||||||
|
proxy_pass https://cdn2.132.us.kg; # 替换为您的源站地址
|
||||||
|
proxy_cache_valid 200 206 60s; # 缓存 .ts 文件 60 秒
|
||||||
|
expires 60s; # 设置浏览器端缓存 60 秒
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user