- This is in responce to this ticket: ecosystem: Add a caddy plugin to serve static files from Minio server. · Issue #3161 · minio/minio
- See also the same setup for Nginx by @harshavardhana
- Note: caddy can't errors from reverse proxy (i.e. 404, 500, etc) as of v0.11.1
- see ticket for more info.
- caddy version (tested):
0.11.1 - minio version (tested): `2019-01-10T00:21:20Z'
- world facing domain URL is:
http://localtest.me- add to hosts file if paranoid
127.0.0.1 localtest.me - minio data storage directory:
/data - minio static website bucket: /site
- minio static website bucket
index.htmlobject: site/index.html - url for the local minio
site/index.htmlinstance object:http://localhost:9000/site/index.html - mc (the minio client) is configured as such for this minio instance:
mc config host add myminio http://127.0.0.1:9000 <AccessKey> <SecretKey>
- start mnio server:
./minio server --address localhost:9000 /data - create
sitebucket in miniomc mb myminio/site - configure object folder for download policy
mc policy download myminio/site - copy files into site
# example mc cp --recursive ~/MyHugoProject/public/* myminio/site/ - configure caddy config file
Caddyfilehttp://localtest.me/myhugosite { rewrite / { r ^.*/$ to {path} {path}/ {dir}/index.html } proxy / http://localhost:9000/site/ { #transparent #superfluious } } - restart caddy
- test static site deployment: http://localtest.me/myhugosite