hls配置 hls配置放在 http.server里面 http { server { # HTTP监听端口 listen 8002; location /hls { types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } alias ./temp/hls; # HLS文件存放路径,请替换为你实际的路径 expires -1; add_header 'Cache-Control' 'no-cache'; } } } 启动以后就可以通过 http://localhost:8002/hls/xxx.m3u8来访问了