This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
image: atlassian/default-image:2 | |
definitions: | |
services: | |
redis: | |
image: redis:3.2 | |
memory: 512 | |
mysql: | |
image: mysql:5.7 | |
environment: |
#!/bin/bash | |
sudo apt-get update -qq && sudo apt-get -y install \ | |
autoconf \ | |
automake \ | |
build-essential \ | |
cmake \ | |
git-core \ | |
libass-dev \ | |
libfreetype6-dev \ |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./permission"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
Add a new user to the www-data group | |
In this example, add a new user called vivek to the www-data group, enter: | |
sudo useradd -g www-data vivek | |
### set the password for vivek user ### | |
sudo passwd vivek | |
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
#! /usr/bin/env bash | |
# Install any build dependencies needed for curl | |
sudo apt-get build-dep curl | |
# Get latest (as of Feb 25, 2016) libcurl | |
mkdir ~/curl | |
cd ~/curl | |
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
tar -xvjf curl-7.50.2.tar.bz2 |
ffmpeg -i rtmp://server.ip/application/streamname -c copy -f flv rtmp://server.ip/application/streamname
ffmpeg -i %1 -c copy -copyts %1.flv
ffmpeg -i %1 -t 00:05:00 -c copy -copyts %1.mp4