Home  >  Article  >  Operation and Maintenance  >  How to add mp4 streaming support to Nginx

How to add mp4 streaming support to Nginx

王林
王林forward
2023-05-12 09:07:052113browse

Download

Copy code The code is as follows:

#Download and decompress
wget wget
tar zxf nginx_mod*.tar.gz

Configuration addition

Copy code The code is as follows:


#View compilation parameters
/usr/local/nginx/sbin/nginx -v
#Enter the nginx (tengine) source code directory
cd tengine*
./configure --add-module=../nginx_mod_h264_streaming-2.2.7 \
                                                                     . Group = www \
-prefix =/usr/local/nginx \
--With-pcre
# just need make instant

#Configuration

Copy code The code is as follows:

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
cp objs/nginx /usr/local/nginx/sbin/nginx
#Configuration configuration file
vim /usr/local/nginx/conf/nginx.conf
location ~ \.mp4$ {
        mp4;
}
#Test
/usr/local/nginx/sbin/nginx -t
#Smooth restart
/usr/local/nginx/sbin/nginx -s reload

How to add mp4 streaming support to Nginx

#There are quite a lot of configuration changes that need to be made, friends, please look carefully and don’t miss them.

The above is the detailed content of How to add mp4 streaming support to Nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete