# SRS 配置文件 - 直播系统 listen 1935; max_connections 1000; daemon off; srs_log_tank console; http_server { enabled on; listen 8080; dir ./objs/nginx/html; crossdomain on; } http_api { enabled on; listen 1985; } vhost __defaultVhost__ { # HLS 配置 hls { enabled on; hls_fragment 2; hls_window 10; hls_path ./objs/nginx/html; hls_m3u8_file [app]/[stream].m3u8; hls_ts_file [app]/[stream]-[seq].ts; } # HTTP-FLV 配置 (低延迟) http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } # HTTP 回调配置 http_hooks { enabled on; on_publish http://api-server:3001/api/srs/on_publish; on_unpublish http://api-server:3001/api/srs/on_unpublish; } # GOP 缓存,提高首屏速度 play { gop_cache on; queue_length 10; } }