2020-09-14 08:07:57 +00:00
|
|
|
# This file is part of Ghostream
|
|
|
|
# Copyright (C) 2020 by Crans <roots@crans.org>
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
# Reverse RTMPS to RTMP
|
|
|
|
# As the user may put a password in his stream key, we only expose RTMPS.
|
|
|
|
stream {
|
|
|
|
server {
|
|
|
|
listen 1935 ssl;
|
|
|
|
listen [::]:1935 ssl;
|
|
|
|
|
|
|
|
# Send to NGINX RTMP server
|
|
|
|
proxy_pass 127.0.0.1:1925;
|
|
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/stream.crans.org/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/stream.crans.org/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rtmp {
|
|
|
|
server {
|
|
|
|
listen 127.0.0.1:1925;
|
|
|
|
chunk_size 4096;
|
2020-09-15 13:48:03 +00:00
|
|
|
|
|
|
|
# Application to authenticate incoming stream
|
|
|
|
application stream {
|
|
|
|
# Publish only
|
|
|
|
allow publish all;
|
|
|
|
deny play all;
|
|
|
|
|
2020-09-14 08:07:57 +00:00
|
|
|
live on;
|
|
|
|
record off;
|
2020-09-15 13:48:03 +00:00
|
|
|
|
|
|
|
# if publish succeed, it will redirect to /play/
|
2020-09-15 07:26:44 +00:00
|
|
|
on_publish http://127.0.0.1:8080/rtmp/auth;
|
2020-09-14 08:07:57 +00:00
|
|
|
}
|
2020-09-15 13:48:03 +00:00
|
|
|
|
|
|
|
# Application to play stream
|
|
|
|
application play {
|
|
|
|
# Playback only
|
|
|
|
allow publish 127.0.0.1;
|
|
|
|
deny publish all;
|
|
|
|
allow play all;
|
|
|
|
|
|
|
|
live on;
|
|
|
|
record off;
|
|
|
|
|
|
|
|
# Send to OvenMediaEngine
|
|
|
|
push rtmp://127.0.0.1:1915;
|
|
|
|
}
|
2020-09-14 08:07:57 +00:00
|
|
|
}
|
|
|
|
}
|