提供二進位制檔案
為了從配置伺服器提供二進位制檔案,您需要傳送一個值為 application/octet-stream
的 Accept
請求頭。
Git, SVN 和 Native 後端
考慮以下針對 GIT 或 SVN 倉庫或 native 後端的示例
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 參考指南所述。