User:Nathanlkoch/Tutorials/Streaming

NGINX Config
{{CodeBox|####### RTMP STREAMING SERVER rtmp { server { listen 127.0.0.1:19361; chunk_size 4096;

application secret-key { live on; # Turn on HLS hls on; hls_path /var/www/html/domain.com/hls1/; hls_fragment 3; hls_playlist_length 5s; hls_type event; #include pull.conf; record off; allow publish 127.0.0.1; # publishing through rtmps://video.domain.com:1936 allow play all;    # for the pull from rtmp://localhost:19351/live }   }

server { listen 127.0.0.1:19351; chunk_size 4096;

application live { live on; record off; # Turn on HLS hls on; hls_path /var/www/html/domain.com/hls/; hls_fragment 3; hls_playlist_length 5s; allow publish all;        # no need to publish on /live -- IMPORTANT!!! allow play all;    # playing through rtmps://video.domain.com:1935/live

pull rtmp://127.0.0.1:19361/secret-key; }   } }

stream { upstream publish { server 127.0.0.1:19361; }   server }   server { listen 1936 ssl;       # additional port for publishing proxy_pass publish; proxy_protocol on; ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;

allow 10.0.0.0/16;    # -- also supports CIDR notation! }
 * 1)        allow 10.0.0.1;        # allow publish from this IP
 * 2)         allow all;
 * 1)        deny all;               # deny publish from the rest

upstream live { server 127.0.0.1:19351; }   server { listen 1935 ssl;       #add ssl standard RTMP(S) port proxy_pass live; ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; allow [0.0.0.0 SECRETIP]; deny all;             # this is public (this is also the default) } }|title=/etc/nginx/nginx.conf|lang=}} Then set OBS to stream to rtmps://domain.com:1935/live with your nginx locked to your local ip.