Inspired by https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html, 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
- Your minio server is at
https://minio.example.com
- Your minio console will be at
https://minio.example.com/minio/ui/
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
handlers are optional—they're just left as examples of how you could handle these requests.
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
}
}