注:minio安装成功之后,可以尝试访问是否访问成功。例如:本教程创建了一个Buckets为【test】那么可以尝试访问【ip + (开放文件服务器访问端口)+文件名称】。如下图:
3.配置Nginx
在完成【1】的基础上 完成配置,配置如下(可直接引用):
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
charset utf-8,gbk;
location / {
#开启自定义错误页面
proxy_intercept_errors on;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
#test改成你自己的存储桶名称,注意:末尾需要带有一个/
proxy_pass http://127.0.0.1:9090/test/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#客户端缓存时间,这里设置为7天,根据自己的需要设置即可
expires 7d;
add_header XCDN-Cache "$upstream_cache_status";
#配置404页面
error_page 404 /404.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
如有问题可私信我