Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Created October 13, 2018 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanpuyue/43691d3252caf81c458df94377e87621 to your computer and use it in GitHub Desktop.
Save nanpuyue/43691d3252caf81c458df94377e87621 to your computer and use it in GitHub Desktop.
# 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
';
}
}
}
@GoldenBookCover
Copy link

我是冲着头像来的。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment