config: Add 3 and update 5 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s

This commit is contained in:
Your Name
2025-09-02 00:11:15 +12:00
parent 79c69ee08b
commit 7d1a1b3f0c
8 changed files with 493 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=hls_cache:10m max_size=1g inactive=60m use_temp_path=off;
server {
listen 80;
listen 8880;
server_name _;
root /usr/share/nginx/html;
@@ -37,7 +37,7 @@ http {
# HLS streams proxy
location /hls/ {
proxy_pass http://localhost:8888/;
proxy_pass http://[::1]:8888/;
proxy_http_version 1.1;
# CORS headers
@@ -54,22 +54,36 @@ http {
proxy_request_buffering off;
}
# WebRTC signaling
# WebRTC signaling (WHEP)
location /webrtc/ {
proxy_pass http://localhost:8889/;
proxy_pass http://[::1]:8889/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# CORS headers for WebRTC
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PATCH, DELETE" always;
add_header Access-Control-Allow-Headers "Authorization, Content-Type, If-Match" always;
add_header Access-Control-Expose-Headers "Link" always;
# Handle OPTIONS preflight
if ($request_method = OPTIONS) {
return 204;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
# MediaMTX API
location /api/mediamtx/ {
proxy_pass http://localhost:9997/;
proxy_pass http://[::1]:9997/;
allow 127.0.0.1;
allow 172.16.0.0/12;
deny all;