本文共 1394 字,大约阅读时间需要 4 分钟。
以安装rtmp媒流模块为例
[root@LNMP nginx-1.8.1]# git clone https://github.com/arut/nginx-rtmp-module.git
[root@LNMP nginx-1.8.1]# nginx -V
输出示例:
nginx version: nginx/1.8.1
[root@LNMP nginx]# cd /root/tools/nginx-1.8.1[root@LNMP nginx-1.8.1]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_ssl_module --add-module=/root/tools/nginx-1.8.1/nginx-rtmp-module
[root@LNMP nginx-1.8.1]# make
[root@LNMP ssl]# openssl genrsa -des3 -out test.key 1024
[root@LNMP ssl]# openssl rsa -in test.key -out test_nopass.key
[root@LNMP ssl]# openssl req -new -key test.key -out test.csr
[root@LNMP ssl]# openssl x509 -req -days 365 -in test.csr -signkey test.key -out test.crt
[root@LNMP ssl]# vim /usr/local/nginx/conf/nginx.conf
添加如下内容:
server { listen 80; server_name localhost; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/test.crt; ssl_certificate_key /usr/local/nginx/conf/test_nopass.key;} [root@LNMP ssl]# nginx -s reload
-----------------------------------end-----------------------------------------------------
转载地址:http://owjfk.baihongyu.com/