Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating public access to minio storage

Tags:

nginx

minio

I am running minio in a docker container and I want files that are uploaded to be accessible by the public. I have tried with nginx however that is just a reverse proxy. The problem is that minio has a access key and a secret so if I setup nginx as a reverse proxy I still need to login.

I want to make it possible to download files through nginx or apache. Is there a way to make files/buckets within minio publicly accessible without having to login so that I can create direct links to the file?

like image 460
Martijn Hiemstra Avatar asked Dec 18 '20 08:12

Martijn Hiemstra


People also ask

How do I access MinIO data?

To open up the MongoDB shell, run the mongo command from your server prompt. By default, the mongo command opens a shell connected to a locally-installed MongoDB instance running on port 27017 . Try running the mongo command with no additional parameters: mongo.


2 Answers

To set the default policy for unauthenticated users, the command is mc policy set download minio_alias/bucketname

Source: https://docs.min.io/docs/minio-client-complete-guide.html

For an example of using nginx for hosting the files, here's a github gist: How to configure static website using Nginx with MinIO?

like image 191
Dash Avatar answered Oct 23 '22 03:10

Dash


# list default hosts after install: 
mc config host ls

# remove all hosts: mc config host rm {hostName}
mc config host rm local

# add your host: mc config host add {hostName} {url} {apiKey} {apiSecret}
mc config host add local http://127.0.0.1:9000 ClientIdASSDSD ClientSecretASASASdsasdasdasdasd

# create bucket: mc mb {host}/{bucket}
mc mb local/mybucket

# change bucket policy: mc policy {policy} {host}/{bucket}
mc policy set public local/mybucket
like image 21
tapos ghosh Avatar answered Oct 23 '22 02:10

tapos ghosh