minio使用nginx反向代理的问题

nginx反向代理的问题

minio的配置

创建了一个名为bucket的存储桶,授权了匿名读权限。

通过域名 + bucket + 资源路径,可以正常访问
http://os.springboot.io/bucket/QQ%E5%9B%BE%E7%89%8720160719182707.gif

但是我不想在访问路径前面显示存储桶名称(bucket),我希望对用户隐藏。

所以我配置了一个二级域名,专门用来访问此存储桶中的资源。
bucket.springboot.io

Nginx的配置

# 访问minio管理系统的域名
server {
	listen 80;
	server_name os.springboot.io;
	location / {
		proxy_set_header Host $http_host;
		proxy_pass http://localhost:9000;
	}
}

# 专门用户访问 `bucket` 存储桶中资源的域名
server {
	listen 80;
	server_name bucket.springboot.io;
	location / {
		proxy_set_header Host $http_host;
		proxy_pass http://localhost:9000/bucket;
	}
}

当我尝试用以下地址访问资源的时候,响应307,出现无限重定向
http://bucket.springboot.io/QQ图片20160719182707.gif

求解?

我要怎么配置nginx的反向代理,才能正确的按照我想的方式隐藏 miniobucket 路径 :bear:

解决了,我也不知道咋想。 凭借直觉,在反向代理的地址后面添加了一个斜杠。完事儿!! :roll_eyes:

proxy_pass http://localhost:9000/bucket/;
1 个赞

请问匿名读,直接访问资源URL应该是无法访问才对把,公有读才可以正常访问呢

1 个赞