Configure Minio with Caddy
Inspired by Configure NGINX Proxy for MinIO Server — MinIO Object Storage for Linux, I wanted to configure a Minio server with Caddy Reverse Proxy in front. For some reason, the configuration was more fickle than I expected, so here is the final result for reference.
Assumptions
Environment Variables
Make sure to set MINIO_BROWSER_REDIRECT_URL to the correct URL including the trailing slash
MINIO_BROWSER_REDIRECT_URL="https://minio.example.com/minio/ui/"
Caddyfile
The robots.txt and favicon.ico are optional, just left as an example of how you could handle these.
minio.example.com {
handle /minio/ui/* {
uri strip_prefix /minio/ui
reverse_proxy localhost:9001
}
handle /robots.txt {
respond "User-agent: *
Disallow: /"
}
handle /favicon.ico {
respond 404
}
handle /* {
reverse_proxy localhost:9000
}
}