Thursday, January 27, 2022

How To install Ant Media Server With Nginx On Ubuntu 20.04 LTS

 in This Tutorial you will learn " How To install Ant Media Server With Nginx web server On Ubuntu 20.04 LTS"
Ant Media Server is a media streaming server with WebRTC support.
Offcial website - https://antmedia.io/

NGINX is an open-source web server software that serves as a reverse proxy, HTTP load balancer, and email proxy for IMAP, POP3, and SMTP.
_________________________________________________________________________________________
Server - Os:  Ubuntu 20.04.3 LTS 64Bit        | IP -         |Hostname -  
_________________________________________________________________________________________
lsb_release -d ; hostname -I ; hostname ; cd /usr/local/src
wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.0.0/ant-media-server-2.0.0-community-2.0.0-20200504_1842.zip
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh

chmod 755 install_ant-media-server.sh
./install_ant-media-server.sh ant-media-server-2.0.0-community-2.0.0-20200504_1842.zip
systemctl restart antmedia ; systemctl status antmedia

apt update ; apt install nginx -y
systemctl start nginx ; systemctl enable nginx
nano /etc/nginx/conf.d/antmedia.conf
server {
      listen 80;
      server_name www.antmedia.com;

      location / {
          proxy_pass http://127.0.0.1:5080;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          #upgrade to WebSocket protocol when requested
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";
      }
}
nginx -t
systemctl restart nginx
echo "192.168.1.80 www.antmedia.com"  >> /etc/hosts
http://www.antmedia.com  |  admin/yourpassword
__________________________________________________________________________________________


1 comment:

  1. How to add a WEBRTC url as a proxy example if you want to proxy http://127.0.0.1:5080/WebRTCApp/play.html?name=test as root with nginx, how do we do that ?

    ReplyDelete