rtmp {
	server {
		ping 5s;
		listen 1935;
		chunk_size 4096;
		notify_method get;
		publish_notify on;

		application live {
			live on;
			on_publish http://localhost:8999/auth;

			idle_streams off;
			drop_idle_publisher 10s;

			push rtmp://localhost/twitch;
			push rtmp://localhost/youtube;

			include /etc/nginx/rtmp-recordings.conf;

			exec_publish bash -c "/etc/nginx/publish_start.sh '${name}' '${path}' '${basename}'";
			exec_publish_done bash -c "/etc/nginx/publish_done.sh '${name}' '${path}' '${basename}'";
			exec_record_done bash -c "/etc/nginx/record_done.sh '${name}' '${path}' '${basename}'";
		}

		include /etc/nginx/rtmp-twitch.conf;
		include /etc/nginx/rtmp-youtube.conf;
	}
}