From 8c465b9734ff3c2bcf34fa9d6990380c153727c8 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Mon, 3 Mar 2025 21:01:53 +0000 Subject: [PATCH] UPDATE: Changed NGINX to use an auth module --- nginx/nginx.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index f3d97e7..2a46181 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -87,6 +87,8 @@ http { ## Cacheable HLS files, ts location ~ ^/stream/(.+)/(.+\.ts)$ { + # Call backend to check permission + auth_request /auth_stream/$1; alias /user_data/$1/stream/$2; # Let the MPEG-TS video chunks be cacheable @@ -112,6 +114,16 @@ http { expires -1d; } + ## Auth request for HLS + location = /auth_stream/$1 { + internal; + proxy_pass http://web_server:5000/stream/$1/direct_live_status; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location ~ ^/\?token=.*$ { proxy_pass http://frontend:5173; proxy_http_version 1.1;