自学内容网 自学内容网

minio上传文件

用docker搭建minio

mkdir -p /opt/software/data/minio/data
mkdir -p /opt/software/data/minio/conf

docker run --name minio --restart=always \
-p 127.0.0.1:9001:9001 \
-p 127.0.0.1:9090:9090 \
-e "MINIO_ROOT_USER=minio" \
-e "MINIO_ROOT_PASSWORD=123456" \
-v /opt/software/data/minio/data:/data \
-v /opt/software/data/minio/conf:/root/.minio \
-d minio/minio server \
/data --console-address ":9090" --address ":9001"

服务器端口9001
web页面9090
如果不反代直接用服务器ip加端口访问将127.0.0.1:9001:9001与 127.0.0.1:9090:9090 改为 9001:9001 与9090:9090 即可
minio 控制台nginx反代配置

server {
   listen 80;
   server_name xxx.xxx.com;
   return 301 https://$host$request_uri;
}

server {
  listen 443 ssl;
  server_name xxx.xxx.com;

  include ssl-conf;

   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;

   # MinIO 控制台
   location / {
proxy_pass http://127.0.0.1:9090; # MinIO 控制台端口
   }


   location /ws/ {
       proxy_pass http://127.0.0.1:9090; # 替换为你的后端服务器地址
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_set_header Host $host;
       proxy_read_timeout 86400; # 根据需要调整超时时间
   }

}

minio apinginx反代配置

server {
  listen 443 ssl;
  server_name xxx.xxx.com;

  # SSL settings
  ssl_certificate /var/lib/cert/xxx.xxx.crt;
  ssl_certificate_key /var/lib/cert/xxx.xxx.key;

 ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers HIGH:!aNULL:!MD5;

  # Optional: HSTS (HTTP Strict Transport Security)
  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

  location / {
      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;

      # If you are using MinIO with a specific port, specify it here.
      proxy_pass http://127.0.0.1:9001;

      # Increase buffer sizes if needed for large uploads
      client_max_body_size 0; # Disable client body size limit
      proxy_connect_timeout 300s;
      proxy_send_timeout 300s;
      proxy_read_timeout 300s;
      send_timeout 300s;
  }

  # Optional: Redirect HTTP to HTTPS
  listen 80;
  if ($scheme = http) {
      return 301 https://$host$request_uri;
  }
}


原文地址:https://blog.csdn.net/qq_20376949/article/details/144296655

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!