下载MinIO DEB
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20230131022419.0.0_amd64.deb -O minio.deb
sudo dpkg -i minio.deb
启动 MinIO 服务器
mkdir ~/minio_data
#minio_data 存放数据目录
minio server ~/minio_data --console-address :9090
控制台出现下图即可
API 后的 9000端口即sdk调用
Console 后的 9090端口即调用网页
配置nginx
找到nginx.conf
server {
listen 80;
server_name 47.102.218.247;
charset utf-8;
access_log /var/log/nginx/myweb_access.log;
error_log /var/log/nginx/myweb_error.log;
location / {
proxy_pass http://127.0.0.1:9090;
#websocket 的
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 8989;
server_name 47.102.218.247;
charset utf-8;
access_log /var/log/nginx/myweb_access.log;
error_log /var/log/nginx/myweb_error.log;
location / {
proxy_pass http://127.0.0.1:9000;
#websocket 的
proxy_http_version 1.1;
proxy_set_header Upgrade $http_uipgrade;
proxy_set_header Connection "Upgrade";
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
注:
nginx 中这段很关键,不加minio启动后会有问题
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;