- Add Dockerfile with MediaInfo, non-root user, slim base - Add docker-compose.yml with env_file and volume mounts - Add nginx.conf with security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options) - Hide server version (server_tokens off) - Add SECURITY.md with full audit report and deployment guide - Add .dockerignore for clean builds Closes #11, #14, #21, #22
64 lines
2.0 KiB
Nginx Configuration File
64 lines
2.0 KiB
Nginx Configuration File
server {
|
|
listen 443 ssl http2;
|
|
server_name tv.home.ms;
|
|
|
|
# SSL configuration
|
|
ssl_certificate /etc/letsencrypt/live/tv.home.ms/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/tv.home.ms/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
|
|
ssl_prefer_server_ciphers off;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 1d;
|
|
ssl_session_tickets off;
|
|
|
|
# HSTS (#14 - Strict-Transport-Security)
|
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
|
|
|
# Security headers (#14)
|
|
add_header X-Frame-Options "DENY" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' https:; img-src 'self' data: https:; media-src 'self' https:;" always;
|
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
|
|
# Hide server version (#21)
|
|
server_tokens off;
|
|
|
|
# Remove x-response-time-ms header (#22)
|
|
more_clear_headers Set-Cookie;
|
|
|
|
# Proxy to Jellyfin
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8096;
|
|
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;
|
|
|
|
# WebSocket support for Jellyfin
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
}
|
|
|
|
# Block access to sensitive paths
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
|
|
location ~ /\.(ht|well-known) {
|
|
allow all;
|
|
}
|
|
}
|
|
|
|
# HTTP to HTTPS redirect
|
|
server {
|
|
listen 80;
|
|
server_name tv.home.ms;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|