84 lines
1.9 KiB
Nginx Configuration File
84 lines
1.9 KiB
Nginx Configuration File
server {
|
|
|
|
listen 8000;
|
|
|
|
location /cache/videos/ {
|
|
auth_request /api/ping/;
|
|
alias /cache/videos/;
|
|
}
|
|
|
|
location /cache/channels/ {
|
|
auth_request /api/ping/;
|
|
alias /cache/channels/;
|
|
}
|
|
|
|
location /cache/playlists/ {
|
|
auth_request /api/ping/;
|
|
alias /cache/playlists/;
|
|
}
|
|
|
|
location /media/ {
|
|
auth_request /api/ping/;
|
|
alias /youtube/;
|
|
types {
|
|
text/vtt vtt;
|
|
}
|
|
}
|
|
|
|
location /youtube/ {
|
|
# Use signed-URL auth if ?sig= is present, otherwise session auth
|
|
set $auth_endpoint /api/ping/;
|
|
if ($arg_sig) {
|
|
set $auth_endpoint /api/stream-auth/;
|
|
}
|
|
auth_request $auth_endpoint;
|
|
alias /youtube/;
|
|
types {
|
|
video/mp4 mp4;
|
|
}
|
|
}
|
|
|
|
location = /api/stream-auth/ {
|
|
internal;
|
|
include proxy_params;
|
|
proxy_pass http://localhost:8080;
|
|
proxy_pass_request_body off;
|
|
proxy_set_header Content-Length "";
|
|
proxy_set_header X-Original-URI $request_uri;
|
|
}
|
|
|
|
location /api {
|
|
include proxy_params;
|
|
proxy_pass http://localhost:8080;
|
|
}
|
|
|
|
location /admin {
|
|
include proxy_params;
|
|
proxy_pass http://localhost:8080;
|
|
}
|
|
|
|
location /static/ {
|
|
alias /app/staticfiles/;
|
|
}
|
|
|
|
root /app/static;
|
|
index index.html;
|
|
|
|
location ~* ^/(?!static/|cache/).*\.(?:css|js|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
|
try_files $uri $uri/ /index.html =404;
|
|
}
|
|
|
|
location = /index.html {
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
add_header Pragma "no-cache";
|
|
expires 0;
|
|
}
|
|
|
|
location / {
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
add_header Pragma "no-cache";
|
|
expires 0;
|
|
try_files $uri $uri/ /index.html =404;
|
|
}
|
|
}
|