--- a/nginx.conf
+++ b/nginx.conf
@@ -4,7 +4,7 @@ worker_processes  1;
 
 #error_log  logs/error.log;
 #error_log  logs/error.log  notice;
-#error_log  logs/error.log  info;
+error_log  logs/error.log  info;
 
 #pid        logs/nginx.pid;
 
@@ -76,6 +76,16 @@ http {
         #location ~ /\.ht {
         #    deny  all;
         #}
+
+        location /hls {
+            # Serve HLS fragments
+            types {
+                application/vnd.apple.mpegurl m3u8;
+                video/mp2t ts;
+            }
+            root /tmp;
+            add_header Cache-Control no-cache;
+        }
     }
 
 
@@ -114,5 +124,18 @@ http {
     #        index  index.html index.htm;
     #    }
     #}
+}
+
+user root;
+rtmp {
+    server {
+        listen 1935;
 
+        application rtmptest {
+            live on;
+            exec_options on;
+            exec_push /home/jdai12/jdai12/jdai12/nginx-rtmp/ffmpeg.sh -i rtmp://localhost:1935/$app/$name -vcodec copy -vbsf h264_mp4toannexb -acodec copy -f hls -hls_flags delete_segments /tmp/hls/$name.m3u8;
+        }
+    }
 }
+

