Giter Site home page Giter Site logo

secure link about ngx_http_estreaming_module HOT 5 CLOSED

whatvn avatar whatvn commented on August 9, 2024
secure link

from ngx_http_estreaming_module.

Comments (5)

whatvn avatar whatvn commented on August 9, 2024

cannot reproduce here, can you post your config?

from ngx_http_estreaming_module.

arty777 avatar arty777 commented on August 9, 2024

secure_link $arg_secl,$arg_sect;
secure_link_md5 verysecret$arg_sect$remote_addr;

if ($secure_link = "") { return 403; }
if ($secure_link = "0") { return 410; }

rewrite ^(.)/(org)/(..m3u8)?(.) $1/$3?$2=true&$6 last;
rewrite ^(.
)/(org)/([0-9]+)/(..ts)?(.) $1/$4?video=$3&$2=true&$5 last;
rewrite ^(._)/([0-9]+)/(._ts)?(.*) $1/$3?video=$2&$4 last;

http://192.168.88.2:8081/long.m3u8?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 200 OK

Request URL:http://192.168.88.2:8081/org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709
Request Method:GET
Status Code:415 Unsupported Media Type

2015/04/20 12:09:28 [debug] 13493#0: 4 http request line: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1"
2015/04/20 12:09:28 [debug] 13493#0: *4 http uri: "/org/0/long.ts"
2015/04/20 12:09:28 [debug] 13493#0: *4 http args: "secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709"
2015/04/20 12:09:28 [debug] 13493#0: *4 http exten: "ts"
2015/04/20 12:09:28 [debug] 13493#0: *4 http process request header line
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "Host: 192.168.88.2:8081"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "Connection: keep-alive"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "X-Requested-With: ShockwaveFlash/17.0.0.169"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/42.0.2311.90 Safari/537.36"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "Accept: */
"
2015/04/20 12:09:28 [debug] 13493#0: 4 http header: "Referer: http://192.168.88.2:8080/my/test_hls.html"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "Accept-Encoding: gzip, deflate, sdch"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header: "Accept-Language: en-US,en;q=0.8,ru;q=0.6,uk;q=0.4,it;q=0.2"
2015/04/20 12:09:28 [debug] 13493#0: *4 http header done
2015/04/20 12:09:28 [debug] 13493#0: *4 event timer del: 18: 1429521028767
2015/04/20 12:09:28 [debug] 13493#0: *4 rewrite phase: 0
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var
2015/04/20 12:09:28 [debug] 13493#0: *4 posix_memalign: 0000000000E21C10:4096 @16
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "Ekjhg5ynjAboAFs61Z5sqw"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script copy: ","
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1429549709"
2015/04/20 12:09:28 [debug] 13493#0: *4 secure link: "Ekjhg5ynjAboAFs61Z5sqw,1429549709"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script copy: "verysecret"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1429549709"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "192.168.88.100"
2015/04/20 12:09:28 [debug] 13493#0: *4 secure link md5: "verysecret1429549709192.168.88.100"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script value: ""
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal: no
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if: false
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script value: "0"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal: no
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if: false
2015/04/20 12:09:28 [debug] 13493#0: *4 http script regex: "^(.
)/(org)/(..m3u8)?(.)"
2015/04/20 12:09:28 [notice] 13493#0: 4 "^(.)/(org)/(..m3u8)?(.)" matches "/org/0/long.ts", client: 192.168.88.100, server: ufs2.china-
cdn88nmbwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1", host: "192.168.88.2:8081", r
eferrer: "http://192.168.88.2:8080/my/test_hls.html"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script capture: ""
2015/04/20 12:09:28 [debug] 13493#0: *4 http script copy: "/"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script capture: ""
2015/04/20 12:09:28 [debug] 13493#0: *4 http script args
2015/04/20 12:09:28 [debug] 13493#0: *4 http script capture: "org"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script copy: "=true&"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script capture: ""
2015/04/20 12:09:28 [debug] 13493#0: *4 http script regex end
2015/04/20 12:09:28 [notice] 13493#0: *4 rewritten data: "/", args: "org=true&&secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709", client: 192.168
.88.100, server: ufs2.china-cdn88nmbwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1",
host: "192.168.88.2:8081", referrer: "http://192.168.88.2:8080/my/test_hls.html"

2015/04/20 12:09:28 [debug] 13493#0: 4 test location: "/"
2015/04/20 12:09:28 [debug] 13493#0: *4 using configuration "/"
2015/04/20 12:09:28 [debug] 13493#0: *4 http cl:-1 max:1048576
2015/04/20 12:09:28 [debug] 13493#0: *4 rewrite phase: 2
2015/04/20 12:09:28 [debug] 13493#0: *4 post rewrite phase: 3
2015/04/20 12:09:28 [debug] 13493#0: *4 generic phase: 4
2015/04/20 12:09:28 [debug] 13493#0: *4 generic phase: 5
2015/04/20 12:09:28 [debug] 13493#0: *4 access phase: 6
2015/04/20 12:09:28 [debug] 13493#0: *4 access phase: 7
2015/04/20 12:09:28 [debug] 13493#0: *4 post access phase: 8
2015/04/20 12:09:28 [debug] 13493#0: *4 http finalize request: -5, "/?org=true&&secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709" a:1, c:1
2015/04/20 12:09:28 [debug] 13493#0: *4 content phase: 9
2015/04/20 12:09:28 [debug] 13493#0: *4 open index "/ssd/hls/hdd0/index.html"
2015/04/20 12:09:28 [debug] 13493#0: *4 stat() "/ssd/hls/hdd0/index.html" failed (2: No such file or directory)
2015/04/20 12:09:28 [debug] 13493#0: *4 http index check dir: "/ssd/hls/hdd0"
2015/04/20 12:09:28 [debug] 13493#0: *4 content phase: 10
2015/04/20 12:09:28 [error] 13493#0: *4 directory index of "/ssd/hls/hdd0/" is forbidden, client: 192.168.88.100, server: ufs2.china-cdn88nm
bwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1", host: "192.168.88.2:8081", referrer
: "http://192.168.88.2:8080/my/test_hls.html"
2015/04/20 12:09:28 [debug] 13493#0: *4 http finalize request: 403, "/?org=true&&secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709" a:1, c:1
2015/04/20 12:09:28 [debug] 13493#0: *4 http special response: 403, "/?org=true&&secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709"
2015/04/20 12:09:28 [debug] 13493#0: *4 internal redirect: "/error404.html?"
2015/04/20 12:09:28 [debug] 13493#0: *4 rewrite phase: 0
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script value: ""
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal: no
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if: false
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var
2015/04/20 12:09:28 [debug] 13493#0: *4 http script var: "1"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script value: "0"
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal
2015/04/20 12:09:28 [debug] 13493#0: *4 http script equal: no
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if
2015/04/20 12:09:28 [debug] 13493#0: *4 http script if: false
2015/04/20 12:09:28 [debug] 13493#0: *4 http script regex: "^(.
)/(org)/(..m3u8)?(.)"
2015/04/20 12:09:28 [notice] 13493#0: 4 "^(.)/(org)/(..m3u8)?(.)" does not match "/error404.html", client: 192.168.88.100, server: ufs2
.china-cdn88nmbwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1", host: "192.168.88.2:8
081", referrer: "http://192.168.88.2:8080/my/test_hls.html"

2015/04/20 12:09:28 [debug] 13493#0: 4 http script regex: "^(.)/(org)/([0-9]+)/(..ts)?(.)"
2015/04/20 12:09:28 [notice] 13493#0: 4 "^(.)/(org)/([0-9]+)/(..ts)?(.)" does not match "/error404.html", client: 192.168.88.100, serve
r: ufs2.china-cdn88nmbwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1", host: "192.168
.88.2:8081", referrer: "http://192.168.88.2:8080/my/test_hls.html"
2015/04/20 12:09:28 [debug] 13493#0: 4 http script regex: "^(.)/([0-9]+)/(.ts)?(.)"
2015/04/20 12:09:28 [notice] 13493#0: 4 "^(.)/([0-9]+)/(.ts)?(.)" does not match "/error404.html", client: 192.168.88.100, server: ufs2.
china-cdn88nmbwacdnln8hq8qwe.com, request: "GET /org/0/long.ts?secl=Ekjhg5ynjAboAFs61Z5sqw&sect=1429549709 HTTP/1.1", host: "192.168.88.2:80
81", referrer: "http://192.168.88.2:8080/my/test_hls.html"
2015/04/20 12:09:28 [debug] 13493#0: *4 test location: "/"
2015/04/20 12:09:28 [debug] 13493#0: *4 test location: "stat"
2015/04/20 12:09:28 [debug] 13493#0: *4 using configuration "/"
2015/04/20 12:09:28 [debug] 13493#0: *4 http cl:-1 max:1048576
2015/04/20 12:09:28 [debug] 13493#0: *4 rewrite phase: 2
2015/04/20 12:09:28 [debug] 13493#0: *4 post rewrite phase: 3
2015/04/20 12:09:28 [debug] 13493#0: *4 generic phase: 4
2015/04/20 12:09:28 [debug] 13493#0: *4 generic phase: 5
2015/04/20 12:09:28 [debug] 13493#0: *4 access phase: 6
2015/04/20 12:09:28 [debug] 13493#0: *4 access phase: 7
2015/04/20 12:09:28 [debug] 13493#0: *4 post access phase: 8
2015/04/20 12:09:28 [debug] 13493#0: *4 http set discard body
2015/04/20 12:09:28 [debug] 13493#0: *4 http finalize request: 415, "/error404.html?" a:1, c:2
2015/04/20 12:09:28 [debug] 13493#0: *4 http special response: 415, "/error404.html?"
2015/04/20 12:09:28 [debug] 13493#0: *4 http set discard body
2015/04/20 12:09:28 [debug] 13493#0: *4 HTTP/1.1 415 Unsupported Media Type
Server: nginx
Date: Mon, 20 Apr 2015 09:09:28 GMT
Content-Type: text/html
Content-Length: 590
Connection: close

from ngx_http_estreaming_module.

arty777 avatar arty777 commented on August 9, 2024

I think I understood the reason, the fact that the reference to a playlist fleshpleer I put this: %26
example
http://192.168.88.2:8081/long.m3u8?secl=Ekjhg5ynjAboAFs61Z5sqw%26sect=1429549709

for the reason that Flash does not understand the character "&"

after such links do not work on ts ...

plz check

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

No, flash understands & correctly.
The error is in rewrite rule, it's getting more ugly but it works:

 rewrite ^(.*)/(adbr)/([0-9]+p)/([0-9]+)/(.*ts)\??(.*) $1/$5?video=$4&$2=true&vr=$3&$6 last;
            rewrite ^(.*)/(adbr)/([0-9]+p)/(.*\.m3u8)\??(.*) $1/$4?$2=true&vr=$3&$5 last;
            rewrite ^(.*)/(org)/(.*\.m3u8)\??(.*) $1/$3?$2=true&$6 last;
            rewrite ^(.*)/(org)/([0-9]+)/(.*\.ts)\??(.*) $1/$4?video=$3&$2=true&$5 last;
            rewrite ^(.*)/([0-9]+)/(.*\.ts)\??(.*)  $1/$3?video=$2&$4 last;

please try configuration above, thanks!

from ngx_http_estreaming_module.

arty777 avatar arty777 commented on August 9, 2024

thank you, work fine

from ngx_http_estreaming_module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.