1.介绍
关方文当,https://min.io/docs/minio/linux/index.html?ref=con
2.安装
2.1容器安装
bash
docker run --name minio \
-p 9000:9000 \
-p 9090:9090 \
--net=host \
-d --restart=always \
-e MINIO_ACCESS_KEY=minio \
-e MINIO_SECRET_KEY=minio@123 \
-v /data/minio/data:/data \
-v /data/minio/config:/root/.minio \
minio/minio server /data --console-address ":9000" --address ":9090"
docker run --name minio \
-p 9000:9000 \
-p 9090:9090 \
--net=host \
-d --restart=always \
-e MINIO_ACCESS_KEY=minio \
-e MINIO_SECRET_KEY=minio@123 \
-v /data/minio/data:/data \
-v /data/minio/config:/root/.minio \
minio/minio server /data --console-address ":9000" --address ":9090"
9000--->web管理界面,ip:9000,账户=minio ,密码=minio@123
9090--->接口地址
3.代理
3.1nginx代理UI
bash
server {
listen 443 ssl http2;
server_name domain.com;
ssl_certificate /path/domain.com.crt;
ssl_certificate_key /path/domain.com.key;
ssl_session_timeout 1d;
#ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
proxy_buffering off;
charset utf-8,gbk;
location / {
#开启自定义错误页面
proxy_intercept_errors on;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
#bucket改成你自己的存储桶名称,注意:末尾需要带有一个/
proxy_pass http://127.0.0.1:9000/bucket/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#客户端缓存时间,这里设置为7天,根据自己的需要设置即可
expires 7d;
add_header XCDN-Cache "$upstream_cache_status";
#可以在存储桶事先上传一个html文件或者图片,用作404页面,然后改成存储桶下面的绝对路径,以/开头,如果不需要,可以将其注释
error_page 404 /404.png;
}
}
server
{
# 301重定向
listen 80;
server_name domain.com;
rewrite ^(.*) https://domain.com$1 redirect;
}
server {
listen 443 ssl http2;
server_name domain.com;
ssl_certificate /path/domain.com.crt;
ssl_certificate_key /path/domain.com.key;
ssl_session_timeout 1d;
#ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
proxy_buffering off;
charset utf-8,gbk;
location / {
#开启自定义错误页面
proxy_intercept_errors on;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
#bucket改成你自己的存储桶名称,注意:末尾需要带有一个/
proxy_pass http://127.0.0.1:9000/bucket/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#客户端缓存时间,这里设置为7天,根据自己的需要设置即可
expires 7d;
add_header XCDN-Cache "$upstream_cache_status";
#可以在存储桶事先上传一个html文件或者图片,用作404页面,然后改成存储桶下面的绝对路径,以/开头,如果不需要,可以将其注释
error_page 404 /404.png;
}
}
server
{
# 301重定向
listen 80;
server_name domain.com;
rewrite ^(.*) https://domain.com$1 redirect;
}
3.2nginx代理bucket
bash
server {
listen 80;
server_name devfilename.freehan.ink;
location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://172.26.118.55:9090/bucket_name/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name devfilename.freehan.ink;
location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://172.26.118.55:9090/bucket_name/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- 提前配置下访问权限