{"id":1150,"date":"2020-06-04T10:06:57","date_gmt":"2020-06-04T08:06:57","guid":{"rendered":"http:\/\/ndk.sytes.net\/wordpress\/?p=1150"},"modified":"2020-06-04T10:08:29","modified_gmt":"2020-06-04T08:08:29","slug":"configure-nginx-as-rmtp-server-on-freebsd-12","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=1150","title":{"rendered":"Configure NGINX as RMTP server on FreeBSD 12"},"content":{"rendered":"\n<p>Unfortunately the Nginx package for FreeBSD does not contain the RTMP module, so you need to compile it either from upstream sources or use the FreeBSD ports and enable the RTMP module before compiling:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># portsnap auto\n# cd \/usr\/ports\/www\/nginx\n# make config\n# make\n# make install<\/pre>\n\n\n\n<p>now create a new file name rtmp.conf in \/usr\/local\/etc\/nginx using your favorite editor, i use neovim:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># cd \/usr\/local\/etc\/nginx<br># nvim rtmp.conf<\/pre>\n\n\n\n<p>now paste following code to rtmp.conf:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rtmp {\n    server {\n        listen 1935;\n        chunk_size 4096;\n        application hlslive {\n            live on;\n            hls on;\n            hls_path \/usr\/local\/www\/nginx-dist\/hlslive;\n            hls_fragment 3s;\n            hls_playlist_length 18s;\n        }\n    }\n}<\/pre>\n\n\n\n<p>save it and open nginx.conf and add the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">load_module \/usr\/local\/libexec\/nginx\/ngx_rtmp_module.so;  # &lt;-- must be loaded at the top of the file<br>include rtmp.conf;  # &lt;-- can be at the end of the file<\/pre>\n\n\n\n<p>check if the config is valid:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># nginx -t<\/pre>\n\n\n\n<p>if valid you can start your Nginx\/RTMP server and send the first RTMP to it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unfortunately the Nginx package for FreeBSD does not contain the RTMP module, so you need to compile it either from upstream sources or use the FreeBSD ports and enable the RTMP module before compiling: # portsnap auto # cd \/usr\/ports\/www\/nginx # make config # make # make install now create a new file name rtmp.conf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-1150","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1150"}],"version-history":[{"count":2,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1150\/revisions"}],"predecessor-version":[{"id":1152,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1150\/revisions\/1152"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}