Ubuntu安装minio并nginx部署

下载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;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值