用docker搭建minio
mkdir -p /opt/software/data/minio/data
mkdir -p /opt/software/data/minio/confdocker 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 settingsssl_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 uploadsclient_max_body_size 0; # Disable client body size limitproxy_connect_timeout 300s;proxy_send_timeout 300s;proxy_read_timeout 300s;send_timeout 300s;}# Optional: Redirect HTTP to HTTPSlisten 80;if ($scheme = http) {return 301 https://$host$request_uri;}
}