Spring Profiles
Server
server:
port: 443
servlet.context-path: /
max-http-header-size: 8KB
connection-timeout: 5s
error:
include-stacktrace: never
include-binding-errors: never
include-message: never
tomcat:
threads.max: 200
# リクエストボディの最大サイズ制限
max-swallow-size: 2MB
# POST リクエスト全体の最大サイズ制限
max-http-post-size: 2MB
# アクセスログはページヒット数やユーザーセッション活動の監視に役立ちます
accesslog:
enabled: true
directory: logs
file-date-format: yyyy-MM-dd
prefix: access_log
suffix: .logSSL
server:
port: 443
ssl:
enabled: true
key-alias: <your_alias>
key-password: <keystore_password>
key-store: classpath:local-ssl.p12
key-store-password: <keystore_password>
key-store-type: PKCS12Tomcat
server:
tomcat:
accesslog:
enabled: true
file-date-format: .yyyy-MM-dd
directory: ${dev.tomcat-accesslog-dir}
# 文字
エンコーディング設定
uri-encoding: UTF-8
# 接続
タイムアウト (ミリ秒
)
connection-timeout: 30000
threads:
# 最小
スレッド数
min-spare: 500
# 最大
スレッド数
max: 2500
# 最大
接続
数
max-connections: 5000
# キューが満杯
の場合
に待機
する接続
数
accept-count: 1000Banner
spring:
# 外部
設定
ファイルのインポート
config:
import: optional:sit.yml
# コンソール ANSI カラー出力
output:
ansi:
enabled: always
# 起動
バナーの場所
banner:
location: banner.txtLogging
# ログ設定の例
logging:
config: classpath:logback-spring.xml
exception-conversion-word: "Logging Occur Error"
file:
path: ${dev.logging-file-path}
charset:
file: UTF-8
level:
root: info
logback:
rollingpolicy:
max-file-size: 10MB
max-history: 7Datasource
H2
spring:
h2:
console:
path: '/h2'
enabled: true
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:testdb
username: 'sa'
password:
jpa:
show-sql: true
hibernate:
ddl-auto: update
database-platform: org.hibernate.dialect.H2DialectMySQL
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/DB_NAME?useSSL=false&serverTimezone=Asia/Taipei
username:
password:Postgres
spring:
datasource:
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: postgresJPA
spring:
jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQL8Dialect
generate-ddl: true
hibernate:
ddl-auto: update
show-sql: trueMultiple DataSource
spring:
# 複数
のデータソース名
を設定
datasource:
# 第
1データソース
organization:
url: ${sit.org-db-url}
username: ${sit.org-db-name}
password: ${sit.org-db-pass}
driver-class-name: com.mysql.cj.jdbc.Driver
# 第
2データソース
coturn:
url: ${sit.coturn-db-url}
username: ${sit.coturn-db-name}
password: ${sit.coturn-db-pass}
driver-class-name: com.mysql.cj.jdbc.DriverRedis
spring:
redis:
database: 0
password:
lettuce:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0Security
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://cognito-idp.${sit.aws-region}.amazonaws.com/${sit.aws-user-pool-id}
jwk-set-uri: https://cognito-idp.${sit.aws-region}.amazonaws.com/${sit.aws-user-pool-id}/.well-known/jwks.jsonSpring Doc OpenAPI
# Swagger UI と OpenAPI ドキュメントのアクセスパス
springdoc:
api-docs:
path: /api-docs
enabled: true
swagger-ui:
path: /swagger-ui.html
enabled: true
cache:
disabled: false
writer-with-default-pretty-printer: true