nginx config https 转 http 访问 m3u8如 httpsxtocomproxy1111512157951decordlistm3u8
以下是将 HTTPS 转换为 HTTP 并允许访问 M3U8 文件的 Nginx 配置示例:
server {
listen 443 ssl;
server_name x.to.com;
ssl_certificate /path/to/ssl/certificate.crt;
ssl_certificate_key /path/to/ssl/certificate.key;
location /proxy/ {
proxy_pass http://$http_host$request_uri;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
# Allow M3U8 files
location ~* \.m3u8$ {
allow all;
}
}
# Redirect HTTP to HTTPS
if ($scheme != "https") {
return 301 https://$server_name$request_uri;
}
}
server {
listen 80;
server_name x.to.com;
# Redirect HTTP to HTTPS
return 301 https://$server_name$request_uri;
}
这个配置将监听 HTTPS 请求并将其代理到 HTTP URL。它还将允许对 M3U8 文件的访问,并将重定向所有 HTTP 请求到 HTTPS。请注意,您需要将 SSL 证书和密钥路径替换为正确的路径。
原文地址: http://www.cveoy.top/t/topic/brMp 著作权归作者所有。请勿转载和采集!