From 3257fdcfb644c5082675fa728cf7023d1f738276 Mon Sep 17 00:00:00 2001 From: Alf Date: Wed, 21 Nov 2018 22:54:46 -0800 Subject: [PATCH] Update readme with ssl docs. Updated nginx.conf. --- README.md | 9 ++++++++- nginx.conf | 14 ++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 18e0df1..25a5a8e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,14 @@ rtmp://:1935/stream/$STREAM_NAME ``` ### SSL -The `nginx.conf` is configured for both HTTP and HTTPS using a self-signed certificate supplied in [/certs](/certs). If you wish to use HTTPS, it is **highly recommended** to obtain your own certificates and update the `ssl_certificate` and `ssl_certificate_key` paths in [nginx.conf](nginx.conf). +To enable SSL, see [nginx.conf](nginx.conf) and uncomment the lines: +``` +listen 443 ssl; +ssl_certificate /opt/certs/example.com.crt; +ssl_certificate_key /opt/certs/example.com.key; +``` + +This will enable HTTPS using a self-signed certificate supplied in [/certs](/certs). If you wish to use HTTPS, it is **highly recommended** to obtain your own certificates and update the `ssl_certificate` and `ssl_certificate_key` paths. I recommend using [Certbot](https://certbot.eff.org/docs/install.html) from [Let's Encrypt](https://letsencrypt.org). diff --git a/nginx.conf b/nginx.conf index 8985223..bc2bd93 100644 --- a/nginx.conf +++ b/nginx.conf @@ -26,7 +26,8 @@ rtmp { live on; hls on; hls_fragment_naming system; - hls_fragment 5s; + hls_fragment 5; + hls_playlist_length 10; hls_path /opt/data/hls; hls_nested on; @@ -46,12 +47,13 @@ http { ssl_session_timeout 10m; server { - listen 80; # Remove this line if you want HTTPS only. - listen 443 ssl; + listen 80; - # Update these paths with your own certificate and private key. - ssl_certificate /opt/certs/example.com.crt; - ssl_certificate_key /opt/certs/example.com.key; + # Uncomment these lines to enable SSL. + # Update the ssl paths with your own certificate and private key. + # listen 443 ssl; + # ssl_certificate /opt/certs/example.com.crt; + # ssl_certificate_key /opt/certs/example.com.key; location /hls { types {