hls.edge.conf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Note that this is for NGINX server, not SRS.
  2. worker_processes 3;
  3. events {
  4. worker_connections 10240;
  5. }
  6. http {
  7. # For Proxy Cache.
  8. proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=srs_cache:8m max_size=1000m inactive=600m;
  9. proxy_temp_path /tmp/nginx-cache/tmp;
  10. server {
  11. listen 8081;
  12. # For Proxy Cache.
  13. proxy_cache_valid 404 10s;
  14. proxy_cache_lock on;
  15. proxy_cache_lock_age 300s;
  16. proxy_cache_lock_timeout 300s;
  17. proxy_cache_min_uses 1;
  18. location ~ /.+/.*\.(m3u8)$ {
  19. proxy_pass http://127.0.0.1:8080$request_uri;
  20. # For Proxy Cache.
  21. proxy_cache srs_cache;
  22. proxy_cache_key $scheme$proxy_host$uri$args;
  23. proxy_cache_valid 200 302 10s;
  24. }
  25. location ~ /.+/.*\.(ts)$ {
  26. proxy_pass http://127.0.0.1:8080$request_uri;
  27. # For Proxy Cache.
  28. proxy_cache srs_cache;
  29. proxy_cache_key $scheme$proxy_host$uri;
  30. proxy_cache_valid 200 302 60m;
  31. }
  32. }
  33. }