worker_processes 1; events { worker_connections 1024; } http { #Nginx开启websocket支持 map $http_upgrade $connection_upgrade { default upgrade; '' close; } server{ listen 1935; server_name 192.168.10.10; #监控视频点播服务 location ~ /hls/(\w+)/index\.m3u8 { proxy_ignore_client_abort on; proxy_pass http://192.168.10.10:49355/hls_server/process/$1; proxy_redirect off; } #监控视频点播服务 location /hls { types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } add_header Cache-Control no-cache; #后端配置支持HTTP1.1,必须配 proxy_http_version 1.1; proxy_set_header Connection ""; #存放hls切片的路径 alias 'E:/idea_workspace/monitor-rtsp-hls/third/hls'; autoindex on; expires 1h; } #预览所有监控 location / { proxy_pass http://192.168.10.10:49355/hls_server/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } }