Create a Video on Demand (VoD) Server
This tutorial explains how to deploy a Video on Demand (VoD) server inside Plaza6G using the Nginx web server. The VoD server allows UEs to download or stream video files through a 5G data network.
Requirements
To begin, you must deploy one of the Plaza6G experiment templates: either the Simulated Template or the InLab Template. Ensure that the setup includes a DNN VM, since it will host the VoD server.
Refer to the general environment setup documentation before continuing.
1 Install Nginx
Once your 5G experiment is fully deployed and the UE has a working PDU session, access your DNN VM using SSH or RDP.
Install Nginx and wget:
sudo apt update
sudo apt install -y nginx wget
2 Create the Video Directory
Create a folder where video resources will be stored:
sudo mkdir -p /var/www/vod
Change ownership so that your user can upload and manage files:
sudo chown -R $USER:$USER /var/www/vod
3 Download a Video
Navigate to the video folder:
cd /var/www/vod
For this tutorial, download the sample video Big Buck Bunny:
wget https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
4 Configure Nginx to Serve Videos
The Nginx configuration will:
- Listen on port 80
- Serve files from
/var/www/vod - Enable directory listing (autoindex)
- Allow external requests (CORS)
sudo tee /etc/nginx/sites-available/vod <<'EOF'
server {
listen 80;
server_name _;
root /var/www/vod/;
autoindex on;
location / {
try_files $uri $uri/ =404;
}
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Headers "*";
}
EOF
5 Enable the Nginx Site
5.1 Enable the Site
sudo ln -sf /etc/nginx/sites-available/vod /etc/nginx/sites-enabled/vod
5.2 Remove the Default Site
sudo rm -f /etc/nginx/sites-enabled/default
5.3 Validate the Configuration
sudo nginx -t
5.4 Reload Nginx
sudo systemctl reload nginx
5.5 Allow HTTP Traffic
sudo ufw allow 80/tcp
sudo ufw status
6 Testing
6.1 Test Locally on the DNN VM
curl -I http://localhost/BigBuckBunny.mp4
A successful response looks like:
HTTP/1.1 200 OK
Content-Type: video/mp4
Access-Control-Allow-Origin: *
6.2 Test from a UE VM
Force the curl request to go through the 5G interface:
curl --interface uesimtun0 -I http://10.15.31.107/BigBuckBunny.mp4
6.3 Test on a Real UE
Simply open the browser on your mobile device:
http://10.15.31.107/BigBuckBunny.mp4
7 Optional: Generate Your Own Video
You can generate a synthetic test video using ffmpeg:
sudo apt install -y ffmpeg
ffmpeg -f lavfi -i testsrc=size=1280x720:rate=30 -t 10 -pix_fmt yuv420p /var/www/vod/demo.mp4