一、检查配置文件是否正确:
/usr/local/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
检查结果:
nginx: [emerg] nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
错误原因:由于给server少了一个大括号},修个合适后:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
rtmp监听1935端口:
保存完配置文件后,启动nginx,通过netstat -ltn命令可以看到增加了一个1935端口的监听.8080是nginx默认的http监听端口.
Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0.0.0.0:* LISTEN tcp 0.0.0.0:* LISTEN tcp 0.0.0.0:* LISTEN tcp 0.0.0.0:* LISTEN tcp 0.0.0.0:* LISTEN tcp 0.0.0.0:* LISTEN