为了从配置服务器提供二进制文件,您需要发送 .Acceptapplication/octet-streamSpring中文文档

Git、SVN 和本机后端

请考虑以下 GIT 或 SVN 存储库或本机后端的示例:Spring中文文档

application.yml
nginx.conf

这可能类似于以下列表:nginx.confSpring中文文档

server {
    listen              80;
    server_name         ${nginx.server.name};
}

application.yml可能类似于以下列表:Spring中文文档

nginx:
  server:
    name: example.com
---
spring:
  profiles: development
nginx:
  server:
    name: develop.com

资源可能如下所示:/sample/default/master/nginx.confSpring中文文档

server {
    listen              80;
    server_name         example.com;
}

/sample/development/master/nginx.conf可能如下所示:Spring中文文档

server {
    listen              80;
    server_name         develop.com;
}

AWS S3系列

要启用为 AWS s3 提供纯文本服务,Config Server 应用程序需要包含对 的依赖项。 有关如何设置该依赖项的详细信息,请参阅 Spring Cloud AWS 参考指南。 此外,将 Spring Cloud AWS 与 Spring Boot 一起使用时,包含自动配置依赖项很有用。 然后,您需要配置 Spring Cloud AWS,如 Spring Cloud AWS 参考指南中所述。io.awspring.cloud:spring-cloud-aws-contextSpring中文文档

解密纯文本

默认情况下,不会解密纯文本文件中的加密值。要启用纯文本文件的解密,请将 和spring.cloud.config.server.encrypt.enabled=truespring.cloud.config.server.encrypt.plainTextEncrypt=truebootstrap.[yml|properties]Spring中文文档

只有 YAML、JSON 和 properties 文件扩展名支持解密纯文本文件。

如果启用此功能,并且请求了不受支持的文件扩展,则不会解密文件中的任何加密值。Spring中文文档

只有 YAML、JSON 和 properties 文件扩展名支持解密纯文本文件。