commit 65d104205620fd024fe3845b724b5faac738946a Author: Gabriel Carneiro Date: Thu Feb 27 10:32:51 2025 -0300 initial commit diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..401e59d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +services: + nginx-rtmp: + image: tiangolo/nginx-rtmp + restart: unless-stopped + container_name: nginx-rtmp + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + # - ./stream-auth:/var/www/html/stream-auth:ro + - /var/www/html/stream:/var/www/html/stream + networks: + - traefik-public + labels: + traefik.enable: true + traefik.tcp.routers.rtmps.entrypoints: rtmps + traefik.tcp.routers.rtmps.tls: true + traefik.tcp.routers.rtmps.rule: HostSNI(`*`) + traefik.tcp.services.rtmps.loadbalancer.server.port: 1935 +networks: + traefik-public: + external: true diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f7fcee9 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,45 @@ +user www-data; +worker_processes auto; +rtmp_auto_push on; +events { + worker_connections 768; +} + +# http { +# server { +# listen 80; +# server_name localhost; +# root /var/www/html/stream-auth; +# # location / { +# # proxy_pass http://unix:/run/gunicorn.sock; +# # } +# } +# } + +rtmp { + server { + listen 1935; + chunk_size 4096; + + application live { + live on; + deny play all; + record all; + record_path /var/rec/; + record_max_size 1000000K; + + #notify_method get; + #hls on; + #record off; + #hls_path /var/www/html/stream/hls; + #hls_fragment 3; + #hls_playlist_length 60; + + dash on; + dash_path /var/www/html/stream; + on_publish http://apache/stream_auth/auth.php; + # on_publish http://127.0.0.1:8080/publish_check; + # on_publish http://127.0.0.1:8079/publish_check; + } + } +}