Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Pass arguments to auth_request module from nginx

$
0
0
I want to protext a live HLS stream. I want to use the auth_request module. I want to check if a request is valid by passing a key. So something like: http://domain.com/hls/stream.m3u8?key=xxxxxxx

I have the following setup in nginx.conf:
location /hls {
alias /tmp/hls;
auth_request /hls/auth;
}

location /hls/auth {
proxy_pass http://localhost.com:8080/on_play.php;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}

Now I need to get the key=xxxxx available in http://localhost.com:8080/on_play.php.

I tried a lot but nothing seems to work. I also tried something like:
location /hls {
alias /tmp/hls;
auth_request http://localhost.com:8080/on_play.php?key=$arg_key;
}

But this also doesn't work. There seems not to be a possibility as of to get the key argument in the on_play.php

The $_SERVER["REQUEST_URI"] also doesn't contain the args.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>