|
对于最新的稳定版本,请使用Spring Cloud Config 5.0.0! |
提供二进制文件
为了从配置服务器提供二进制文件,你需要发送一个接受的头部应用/八位元组流.
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 Cloud AWS 配合 Spring Boot 时,包含自动配置依赖也很有用。
然后你需要按照 Spring Cloud AWS 参考指南的描述配置 Spring Cloud AWS。
解密纯文本
默认情况下,纯文本文件中的加密值不会被解密。为了启用纯文本文件的解密,设置spring.cloud.config.server.encrypt.enabled=true和spring.cloud.config.server.encrypt.plainTextEncrypt=true在启动。[YML|属性]
| 解密纯文本文件仅支持YAML文件、JSON和属性文件扩展名。 |
如果启用此功能,且请求不支持的文件扩展,文件中的任何加密值都不会被解密。