OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: fadern on May 12, 2026, 09:42:16 AM

Title: Caddy reverse proxy to Jellyfin
Post by: fadern on May 12, 2026, 09:42:16 AM
Hi,
I have a basic setup of Caddy reverse proxying to my Jellyfin server. Its working but now I want to add some more settings to my Caddy config. Do I need to create a configfile (/usr/local/etc/caddy/caddy.d/*.conf) or is it possible to set these from the gui?


# ===========================
# Reverse Proxy: Jellyfin
# ===========================

xxx.zzz.org {
    encode gzip zstd

    # Security headers
    header {
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
        X-Content-Type-Options "nosniff"
        X-Frame-Options "SAMEORIGIN"
        Referrer-Policy "same-origin"

        # Forwarding headers
        X-Real-IP {remote_host}
        X-Forwarded-For {remote_host}
        X-Forwarded-Proto {scheme}
    }

    # Jellyfin reverse proxy
    handle {
        reverse_proxy 192.168.82.239:30013 {
            # WebSocket support
            transport http {
                versions h1 h2c
            }

            # Improves large uploads & streaming
            buffer_requests
        }
    }
}

# Optional HTTP → HTTPS redirect
http://xxx.zzz.org {
    redir https://xxx.zzz.org{uri}
}

import /usr/local/etc/caddy/caddy.d/*.conf
Title: Re: Caddy reverse proxy to Jellyfin
Post by: Monviech (Cedrik) on May 12, 2026, 09:47:05 AM
Not needed since caddy does that automatically, remove that cruft:

encode gzip zstd
X-Real-IP {remote_host}
X-Forwarded-For {remote_host}
X-Forwarded-Proto {scheme}
http://xxx.zzz.org {
    redir https://xxx.zzz.org{uri}
}

Essentially this should be all you need:

xxx.zzz.org {
    handle {
        reverse_proxy 192.168.82.239:30013 {
            transport http {
                versions h1 h2c
            }

            # Improves large uploads & streaming
            buffer_requests <- dont know about this one
        }
    }
}

If you want to set security headers, use the header menu in the GUI and attach these headers to the handler.