I created new project for testing purpose on DigitalOcean server. and my Nginx conf:
`rtmp {
server {
listen 1935;
chunk_size 4000;
notify_method get;
# video on demand for mp4 files
application vod {
play /usr/vod/mp4s;
}
# video on demand for mp4 files
application mp4 {
play /usr/vod/mp4s;
allow play 127.0.0.1;
allow play 0.0.0.0;
allow play 138.68.73.219;
deny play all;
}
}
}`
The error log says:
access forbidden by rule, client: 157.49.1.236, server: 0.0.0.0:1935
When I open the webpage its not playing the video for application mp4, but its working without allow play directives for application vod.
Kindly correct me where I am wrong.
Thanks
You should read your specified error log more carefully.
Your client IP address is 157.49.1.236 and your configuration of application mp4 reject it.
Whether allow play directive is for server IP or client IP? Kindly let me know as it is not mentioned in wiki directives. Clients IP will not be in my control to restrict playing.
I want to restrict playing the stream on my website only. At present, anybody can embed the code on their web page and play the stream.
Is there any way to do this. I am using laravel app.
In most cases you can understand that allow/deny directives affect client IP.
(I think these are from the feature in nginx)
IMO your plan needs something more software or mechanism because your website will be accessed from anyone, any device and any IP address. We can't control them.
Unfortunately I'm unfamiliar such technologies so I don't know that your plan is achievable or not...
I think it is not going to solve my purpose. Now I decided to go for HLS VOD by storing segments on CDN.
@chichimotsu Thanks for reply