Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Serve static pages from minio through caddy

Serve static pages from minio through caddy


  • caddy version (tested): 0.11.1
  • minio version (tested): `2019-01-10T00:21:20Z'
  • world facing domain URL is:
    • add to hosts file if paranoid
  • minio data storage directory: /data
  • minio static website bucket: /site
  • minio static website bucket index.html object: site/index.html
  • url for the local minio site/index.html instance object: http://localhost:9000/site/index.html
  • mc (the minio client) is configured as such for this minio instance:
    mc config host add myminio <AccessKey> <SecretKey>

General procedure:

  1. start mnio server:
    ./minio server --address localhost:9000 /data
  2. create site bucket in minio
    mc mb myminio/site
  3. configure object folder for download policy
    mc policy download myminio/site
  4. copy files into site
    # example
    mc cp --recursive ~/MyHugoProject/public/* myminio/site/
  5. configure caddy config file Caddyfile {
        rewrite / {
            r ^.*/$
            to {path} {path}/ {dir}/index.html
        proxy / http://localhost:9000/site/ {
            #transparent #superfluious
  6. restart caddy
  7. test static site deployment:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment