2021-04-22 23:04:44 +00:00
|
|
|
server {
|
|
|
|
listen 80;
|
2021-04-26 21:54:10 +00:00
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl http2;
|
|
|
|
server_name "jellyfin.{{ base_domain }}";
|
2021-04-27 21:09:21 +00:00
|
|
|
set $jellyfin jellyfin;
|
2021-04-22 23:04:44 +00:00
|
|
|
|
2021-04-26 16:54:59 +00:00
|
|
|
# Security/XSS Mitigation Headers
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
add_header X-Content-Type-Options "nosniff";
|
|
|
|
|
2021-04-26 21:54:10 +00:00
|
|
|
location = / {
|
|
|
|
return 302 https://$host/web/;
|
|
|
|
}
|
|
|
|
|
2021-04-22 23:04:44 +00:00
|
|
|
location / {
|
|
|
|
proxy_pass http://$jellyfin:8096;
|
|
|
|
proxy_set_header Host $host;
|
2021-04-26 16:54:59 +00:00
|
|
|
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_set_header X-Forwarded-Protocol $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
proxy_buffering off;
|
|
|
|
}
|
|
|
|
|
|
|
|
location = /web/ {
|
|
|
|
proxy_pass http://$jellyfin:8096/web/index.html;
|
|
|
|
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_set_header X-Forwarded-Protocol $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /socket {
|
|
|
|
proxy_pass http://$jellyfin:8096;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
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_set_header X-Forwarded-Protocol $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
2021-04-22 23:04:44 +00:00
|
|
|
}
|
|
|
|
}
|