nginx.conf 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. #Nginx开启websocket支持
  7. map $http_upgrade $connection_upgrade {
  8. default upgrade;
  9. '' close;
  10. }
  11. server{
  12. listen 1935;
  13. server_name 192.168.10.10;
  14. #监控视频点播服务
  15. location ~ /hls/(\w+)/index\.m3u8 {
  16. proxy_ignore_client_abort on;
  17. proxy_pass http://192.168.10.10:49355/hls_server/process/$1;
  18. proxy_redirect off;
  19. }
  20. #监控视频点播服务
  21. location /hls {
  22. types {
  23. application/vnd.apple.mpegurl m3u8;
  24. video/mp2t ts;
  25. }
  26. add_header Cache-Control no-cache;
  27. #后端配置支持HTTP1.1,必须配
  28. proxy_http_version 1.1;
  29. proxy_set_header Connection "";
  30. #存放hls切片的路径
  31. alias 'E:/idea_workspace/monitor-rtsp-hls/third/hls';
  32. autoindex on;
  33. expires 1h;
  34. }
  35. #预览所有监控
  36. location / {
  37. proxy_pass http://192.168.10.10:49355/hls_server/;
  38. proxy_http_version 1.1;
  39. proxy_set_header Upgrade $http_upgrade;
  40. proxy_set_header Connection $connection_upgrade;
  41. }
  42. }
  43. }