# file: nginx.conf | |
# date: 2018-10-13 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
include /etc/nginx/modules-enabled/*.conf; | |
events { | |
worker_connections 768; | |
} | |
rtmp { | |
server{ | |
listen 1935; | |
chunk_size 10240; | |
application live { | |
live on; | |
record off; | |
on_publish http://127.0.0.1:2080/auth; | |
push rtmp://live.twitch.tv/app/xxxxxxxxxx; | |
push rtmp://a.rtmp.youtube.com/xxxxxxxxxx; | |
} | |
} | |
} | |
http { | |
server { | |
listen 127.0.0.1:2080; | |
location /auth { | |
rewrite_by_lua ' | |
ngx.req.read_body() | |
local name = ngx.req.get_post_args().name | |
if (name == "xxxxxxxxxx") then | |
ngx.status = 200 | |
ngx.say("OK") | |
ngx.exit(200) | |
else | |
ngx.status = 403 | |
ngx.say("Forbidden") | |
ngx.exit(403) | |
end | |
'; | |
} | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
https://blog.nanpuyue.com/2018/047.html