1.1 安装Minio

# 下载 MinIO
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio -O /usr/local/bin/minio

# 赋予执行权限并创建数据目录
chmod +x /usr/local/bin/minio && mkdir -p /data

# 启动 MinIO 服务器
minio server /data --address ":9000"

1.1.2 前端启动

c327f06f745892e2fed8bc513273dab

1.2 后台运行 MinIO(可忽略看需求)

vim /etc/systemd/system/minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
After=network.target

[Service]
User=minio
Group=minio
ExecStart=/usr/local/bin/minio server /data --address ":9000"
Restart=always
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

1.3 启动minio

systemctl daemon-reload
systemctl enable --now minio

1.4 安装启动nginx

yum install -y nginx
systemctl start nginx --now

1.4.1 编辑配置文件

vim /etc/nginx/conf.d/minio.conf
server {
    listen 80;
    server_name 10.0.0.130;

    # 代理 MinIO API (端口 9000)
    location / {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

server {
    listen 80;
    server_name 10.0.0.130;

    # 代理 MinIO 控制台 (端口 9001)
    location /minio/ {
        rewrite ^/minio(/.*)$ $1 break;  # 去除 /minio 前缀
        proxy_pass http://localhost:9001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

1.4.2 刷新配置

nginx -t && nginx -s reload

1.5 访问

curl 10.0.0.130

555ec6490c0f9ed3db5887e63ae99ad

curl 10.0.0.130/minio/

555ec6490c0f9ed3db5887e63ae99ad