From 84951cbc74d8aacdeb30a877247acdde5ee7b565 Mon Sep 17 00:00:00 2001 From: mapengfei53 Date: Sat, 5 Mar 2022 17:43:20 +0800 Subject: [PATCH] Update the demo config file for include directive (#2927) * Update the demo config file for include directive * update config file * update config file --- trunk/conf/full.conf | 10 ++++++++++ trunk/conf/include.conf | 20 ++++++++++++++++++++ trunk/conf/include.vhost.conf | 9 +++++++++ 3 files changed, 39 insertions(+) create mode 100644 trunk/conf/include.conf create mode 100644 trunk/conf/include.vhost.conf diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index e01576923..c74b7aa09 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -2113,6 +2113,16 @@ vhost stream.transcode.srs.com { } } +############################################################################################# +# In the config file, the include file can be anywhere in order to enhance the readability +# of the config file and enable the reuse of part of the config file. +# When using include files, make sure that the included files themselves have the correct SRS syntax, +# that is, config directives and blocks, and then specify the paths to these files. +# +# @see https://github.com/ossrs/srs/issues/1399 +############################################################################################# +include include.vhost.conf; + ############################################################################################# # The origin cluster section ############################################################################################# diff --git a/trunk/conf/include.conf b/trunk/conf/include.conf new file mode 100644 index 000000000..fa2e720f6 --- /dev/null +++ b/trunk/conf/include.conf @@ -0,0 +1,20 @@ +# include directive config for SRS. +# @see full.conf for detail config. + +listen 1935; +max_connections 1000; +srs_log_tank console; +daemon off; + +http_api { + enabled on; + listen 1985; +} + +http_server { + enabled on; + listen 8080; + dir ./objs/nginx/html; +} + +include ./conf/include.vhost.conf; diff --git a/trunk/conf/include.vhost.conf b/trunk/conf/include.vhost.conf new file mode 100644 index 000000000..7e0fd4c18 --- /dev/null +++ b/trunk/conf/include.vhost.conf @@ -0,0 +1,9 @@ +vhost include.srs.com { + hls { + enabled on; + } + http_remux { + enabled on; + mount [vhost]/[app]/[stream].flv; + } +}