适用场景
notify、pull、push操作过程中会使用到域名,动态dns查询支持动态更新域名解析。
配置
resolver
Syntax: resolver [dns-server];
Default: -
Context: event
- Desc
向DNS服务器查询服务器中使用到的域名。
resolver_timeout
Syntax: resolver_timeout [time];
Default: 60s
Context: event
- Desc
等待DNS服务器返回结果的超时时间。
dynamic_refresh_interval
Syntax: dynamic_refresh_interval [time];
Default: 5s
Context: event
- Desc
更新域名解析结果的间隔时间。
配置模板
user root;
daemon off;
master_process off;
worker_processes 1;
#worker_rlimit 4g;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
worker_rlimit_nofile 102400;
worker_rlimit_core 2G;
working_directory /tmp;
#pid logs/nginx.pid;
events {
use epoll;
worker_connections 1024;
multi_listen unix:/tmp/http 80;
multi_listen unix:/tmp/rtmp 1935;
dynamic_refresh_interval 2s; # DNS更新间隔
# dynamic_domain_buckets 1001;
resolver 114.114.114.114; # DNS服务器
resolver_timeout 30s; # DNS超时查询
}
rtmp {
server {
listen 1935;
application * {
pull rtmp://live.pingos.io/live/ice app=live; # 对域名 live.pingos.io 解析
live on;
}
}
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 80;
location / {
chunked_transfer_encoding on;
root html/;
}
}
}