0%

s3 minio学习

s3 minio学习

直接采用docker方式运行,docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
version: '3'

services:
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./data:/data
- ./config:/root/.minio
environment:
MINIO_ROOT_USER: whx
MINIO_ROOT_PASSWORD: Whxheart0210
command: server --console-address ":9001" /data

然后nginx做反向代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
server {

listen 80;
server_name s3.haowujidian.com;
client_max_body_size 20M;

root /data/www/s3.haowujidian.com;
error_page 403 404 /404.php;
index index.html index.htm index.php;
try_files $uri /index.html;
error_log /var/log/nginx/nginx-error.s3.log;
access_log /var/log/nginx/nginx-access.s3.log;
charset "utf-8";
add_header X-Content-Type-Options nosniff;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' data:;script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none';style-src 'self' 'unsafe-inline'; child-src https:";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000";


location / {
charset "utf8";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_connect_timeout 10000;
proxy_read_timeout 10000;
keepalive_timeout 6000;
#port_in_redirect off;
proxy_pass http://127.0.0.1:9000;
}

}

server {

listen 80;
server_name s3-console.haowujidian.com;
client_max_body_size 20M;

root /data/www/s3.haowujidian.com;
error_page 403 404 /404.php;
index index.html index.htm index.php;
try_files $uri /index.html;
error_log /var/log/nginx/nginx-error.s3.log;
access_log /var/log/nginx/nginx-access.s3.log;
charset "utf-8";
add_header X-Content-Type-Options nosniff;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' data:;script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none';style-src 'self' 'unsafe-inline'; child-src https:";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000";


location / {
charset "utf8";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_connect_timeout 10000;
proxy_read_timeout 10000;
keepalive_timeout 6000;
#port_in_redirect off;
proxy_pass http://127.0.0.1:9001;
}

}

客户端学习

下载mc客户端

1
2
3
curl --progress-bar -O https://dl.min.io/client/mc/release/darwin-arm64/mc 
chmod +x mc