|
此版本仍在开发中,目前尚不稳定。如需最新稳定版本,请使用 Spring Cloud Config 5.0.1! |
提供二进制文件
为了从配置服务器提供二进制文件,您需要发送一个 Accept 头部和 application/octet-stream。
Git、SVN 和原生后端
考虑以下用于 GIT 或 SVN 仓库或原生后端的示例:
application.yml
nginx.conf
代码 nginx.conf 可能类似于以下列表:
server {
listen 80;
server_name ${nginx.server.name};
}
application.yml 可能类似于以下列表:
nginx:
server:
name: example.com
---
spring:
profiles: development
nginx:
server:
name: develop.com
资源 /sample/default/master/nginx.conf 可能如下所示:
server {
listen 80;
server_name example.com;
}
/sample/development/master/nginx.conf 可能如下所示:
server {
listen 80;
server_name develop.com;
}
AWS S3
为了在 AWS S3 上启用纯文本服务,配置服务器应用程序需要包含对 io.awspring.cloud:spring-cloud-aws-context 的依赖项。有关如何设置该依赖项的详细信息,请参阅 Spring Cloud AWS 参考指南。此外,当在 Spring Boot 中使用 Spring Cloud AWS 时,建议包含 自动配置依赖项。然后,您需要按照 Spring Cloud AWS 参考指南 中所述进行 Spring Cloud AWS 的配置。
解密明文
默认情况下,纯文本文件中的加密值不会被解密。为了启用对纯文本文件的解密功能,请在 bootstrap.[yml|properties] 中设置 spring.cloud.config.server.encrypt.enabled=true 和 spring.cloud.config.server.encrypt.plainTextEncrypt=true。
| 解密纯文本文件仅支持 YAML、JSON 和 properties 文件扩展名。 |
如果启用了此功能,且请求了不支持的文件扩展名,则文件中的任何加密值将不会被解密。