# Jellyfin 프록시 보안 헤더 설정

# 기본 프록시 헤더
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-Host $host;
proxy_set_header X-Forwarded-Server $host;

# 버퍼링 설정 (젤리핀 최적화)
proxy_buffering on;
proxy_request_buffering off;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

# 타임아웃 설정
proxy_connect_timeout 60s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;

# 캐시 비활성화 (실시간 스트리밍용)
proxy_cache off;
proxy_no_cache 1;
proxy_cache_bypass 1;

# HTTP/1.1 연결 유지
proxy_http_version 1.1;
proxy_set_header Connection "";

# 클라이언트 정보 전달
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept $http_accept;
proxy_set_header Accept-Language $http_accept_language;
proxy_set_header Accept-Encoding $http_accept_encoding;
