l 若配置已存在,则进行修改,若配置不存在,则需要进行新增
l 建议先通过租户后台页面“文件设置-存储设置-存储实例-新建实例”,测试连通性
# 存储策略
storage.server=aliyun
#阿里云
# 必填:对象存储账号
aliyun.access_id=
# 必填:对象存储密码
aliyun.access_key=
# 必填:公有桶
aliyun.bucket=
# 必填:阿里云存储地址
aliyun.endpoint=
# 必填: 静态文件私有桶
aliyun.static.i18n=
# 选填:默认true, 是否开启cname解析,私有化阿里云存储建议false
aliyun.cname=
eg.
aliyun.access_id=LTAI5tCBCXXXXXXrqxuACmu
aliyun.access_key=ACPYvQXXXXXXXXXXXXXXXXXXXX52qB9d
aliyun.bucket=eteamstest
aliyun.endpoint=https://oss-cn-shanghai.aliyuncs.com
aliyun.cname=false
aliyun.static.i18n=staticeteams
l 若配置已存在,则进行修改,若配置不存在,则需要进行新增
l ${weaver.env}可以从配置文件 weaver.properties 中查询
l 修改好配置文件后,需要重启nginx
l ${aliyun.endpoint} ${aliyun.static.i18n}可以从配置文件eteams-storage-service.properties中查询
2.1. 国际化模块静态文件访问
location /static/public/resource/i18n {
proxy_pass ${aliyun.endpoint}/${aliyun.static.i18n}/static/public/resource/i18n/${weaver.env};
}
2.2. 云商店模块文件访问
location /ecodestatic {
proxy_pass ${aliyun.endpoint}/${aliyun.static.i18n}/ecodestatic;
}
2.3. 通用静态文件访问
location /visitstatic {
#云端:
proxy_pass ${aliyun.endpoint}/${aliyun.static.i18n}/visitstatic/${weaver.env};
}
# 必须在网关的 location 之前
location /api/file/visitstatic/ {
proxy_pass ${aliyun.endpoint}/${aliyun.static.i18n}/visitstatic/${weaver.env};
}