提供二進位制檔案

為了從配置伺服器提供二進位制檔案,你需要傳送一個 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 提供純文字服務,Config Server 應用程式需要包含對 io.awspring.cloud:spring-cloud-aws-context 的依賴。有關如何設定該依賴項的詳細資訊,請參閱 Spring Cloud AWS 參考指南。此外,當將 Spring Cloud AWS 與 Spring Boot 一起使用時,包含 自動配置依賴項 會很有用。然後,你需要配置 Spring Cloud AWS,如 Spring Cloud AWS 參考指南 中所述。

解密純文字

預設情況下,純文字檔案中的加密值不會被解密。要為純文字檔案啟用解密,請在 bootstrap.[yml|properties] 中設定 spring.cloud.config.server.encrypt.enabled=truespring.cloud.config.server.encrypt.plainTextEncrypt=true

純文字檔案的解密僅支援 YAML、JSON 和 properties 副檔名。

如果啟用此功能,並且請求了不支援的副檔名,則檔案中的任何加密值將不會被解密。

© . This site is unofficial and not affiliated with VMware.