Dispatcharr/docker/nginx.conf
2025-04-03 16:06:00 -04:00

77 lines
2.1 KiB
Nginx Configuration File

server {
listen 9191;
proxy_connect_timeout 75;
proxy_send_timeout 300;
proxy_read_timeout 300;
# Serve Django via uWSGI
location / {
include uwsgi_params;
uwsgi_pass unix:/app/uwsgi.sock;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /assets/ {
root /app/static;
}
location /static/ {
root /app;
}
location /logos/ {
root /data;
}
# admin disabled when not in dev mode
location /admin {
return 301 /login;
}
# Route HDHR request to Django
location /hdhr {
proxy_pass http://127.0.0.1:5656;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
# Serve FFmpeg streams efficiently
location /output/stream/ {
proxy_pass http://127.0.0.1:5656;
proxy_buffering off;
proxy_set_header Connection keep-alive;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
# WebSockets for real-time communication
location /ws/ {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
# Route TS proxy requests to the dedicated instance
location /proxy/ {
proxy_pass http://127.0.0.1:5656;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
client_max_body_size 0;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}