Advertisement
phpface

Nginx - Prevent other domains from accessing video files

Aug 26th, 2022 (edited)
2,180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.24 KB | None | 0 0
  1.     location ~* \.(mp4|m3u8|key|webp|mov)$ {
  2.  
  3.         # Define your domain name
  4.  
  5.         valid_referers none blocked server_names https://your-domain.com*;
  6.  
  7.         if ( $invalid_referer = "" ) {
  8.             return 403;
  9.         }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement