diff --git a/Setting-up-an-HLS-Broadcast-server-with-NGINX.md b/Setting-up-an-HLS-Broadcast-server-with-NGINX.md
index f522a83..a283291 100644
--- a/Setting-up-an-HLS-Broadcast-server-with-NGINX.md
+++ b/Setting-up-an-HLS-Broadcast-server-with-NGINX.md
@@ -26,7 +26,12 @@ The first part of this server config handles ingesting the raw RTMP datastream a
hls_nested on;
hls_path /srv/live;
- hls_fragment 2s;
+ #This changes how nginx splits the streams into files
+ #Increasing fragment length will increase delay
+ #Make sure your keyframe interval in OBS matches this number!
+ #Split Stream into 2 second fragments
+ hls_fragment 2s;
+ #Provide 10 seconds worth of fragments (5 fragments)
hls_playlist_length 10s;
}
}
@@ -36,4 +41,26 @@ The first part of this server config handles ingesting the raw RTMP datastream a
This part of the configuration handles setting up the web server which serves the files that make up the HLS stream.
1. Edit `/etc/nginx/sites-available/default` or create a new site config
Remember to create a symlink and move/delete the default if you create a new file!
-2. Add the following to your site config:
\ No newline at end of file
+2. Add the following to your site config:
+
server {
+ listen 80;
+ listen [::]:80 ipv6only=on;
+
+ root /srv/live;
+
+ server_name your.domain.name;
+
+ location / {
+ #You'll probably want to use this from another site :P
+ add_header Access-Control-Allow-Origin https://domain.to.allow;
+ add_header Cache-Control no-cache;
+
+ #Default to playlist file to allow users to just paste the bare domain
+ try_files $uri $uri/index.m3u8;
+
+ types{
+ application/vnd.apple.mpegurl m3u8;
+ video/mp2t ts;
+ }
+ }
+}
\ No newline at end of file