Caddy reverse proxy to Jellyfin

Started by fadern, Today at 09:42:16 AM

Previous topic - Next topic
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
Intel i7-8550U - Intel I211 - RAM 16GB - NVMe 120Gb
Intel i7-5550U - Intel I211 - RAM 8GB - NVMe 50Gb

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.
Hardware:
DEC740