docs/guide/changing-base.md
Dozzle is commonly placed behind a reverse proxy for TLS termination, authentication, or to share a hostname with other services. This page covers both mounting Dozzle at a sub-path and the proxy settings needed to make streaming work correctly.
Dozzle by default mounts to /. This can be changed with the --base flag or the DOZZLE_BASE environment variable. For example, to mount at /foobar:
::: code-group
docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --base /foobar
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
environment:
DOZZLE_BASE: /foobar
:::
Dozzle will be available at http://localhost:8080/foobar/. This option rewrites all assets to /foobar/{file.path} and automatically redirects /foobar to /foobar/.
Dozzle streams logs over Server-Sent Events (SSE) and uses WebSocket for container shells. Reverse proxies must:
X-Accel-Buffering: no, but some proxies ignore it.text/event-stream — compression middleware often breaks SSE.location ^~ /foobar/ {
proxy_pass http://dozzle:8080;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Drop the ^~ /foobar/ prefix if Dozzle is mounted at the root. See also the FAQ entry on disabling buffering.
Traefik handles WebSocket upgrades automatically, but the default compress middleware will break SSE. Exclude text/event-stream:
http:
middlewares:
middlewares-compress:
compress:
excludedContentTypes:
- text/event-stream
Then a typical labels block on the Dozzle service:
services:
dozzle:
image: amir20/dozzle:latest
labels:
- traefik.enable=true
- traefik.http.routers.dozzle.rule=Host(`dozzle.example.com`)
- traefik.http.routers.dozzle.entrypoints=websecure
- traefik.http.routers.dozzle.tls.certresolver=letsencrypt
- traefik.http.services.dozzle.loadbalancer.server.port=8080
dozzle.example.com {
reverse_proxy dozzle:8080 {
flush_interval -1
}
}
flush_interval -1 disables response buffering for streaming endpoints.
--base — the proxy is stripping the path prefix before forwarding. Configure it to pass the full path through to Dozzle.proxy_read_timeout 3600s).Upgrade and Connection headers.