A
A
Adel1ne2016-11-24 12:07:48
Nginx
Adel1ne, 2016-11-24 12:07:48

How to setup nginx+lua (openresty) + udpxy for IPTV?

Hello!
udpxy is running on the server.
In the nginx config, something like this:

location / {
  access_by_lua_block {
     local mysql = require "resty.mysql"
     -- Идет запрос к БД, если пользователь имеет право смотреть поток то, делаем proxy_pass
     -- иначе обрываем соединение
     ngx.exit(200)
  }
  proxy_pass http://192.168.1.1:80/udp/192.168.1.100:2223;
}

I drive url 192.168.1.1 into VLC , everything starts.
If the user is denied access to the database, then the next time he connects through the player using this url, he will receive an error.
But it is necessary that access is closed directly during viewing.
The problem is that a one-time request goes to nginx, and if during the browsing process, disconnect the user from the database, then nothing will be cut off from him until he restarts the player.
Although TCP requests to the server are constantly going in the user logs, location on nginx does not work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question