chore: 优化部署配置
This commit is contained in:
parent
da64a495ac
commit
4c95bf585f
7
deploy/nginx-api-upload.conf
Normal file
7
deploy/nginx-api-upload.conf
Normal file
@ -0,0 +1,7 @@
|
||||
# 反代到 Spring Boot 时加入(server 或 location /api/ 内)
|
||||
# 默认 client_max_body_size 仅 1m,会导致大视频返回 HTTP 413,小程序提示「文件过大」
|
||||
|
||||
client_max_body_size 200m;
|
||||
proxy_connect_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
46
src/main/resources/application-example.yml
Normal file
46
src/main/resources/application-example.yml
Normal file
@ -0,0 +1,46 @@
|
||||
# 复制为 application.yml 后填写本地/生产配置(application.yml 已加入 .gitignore,勿提交密钥)
|
||||
spring:
|
||||
application:
|
||||
name: petstore-backend
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/petstore?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true
|
||||
username: root
|
||||
password: ${MYSQL_PASSWORD:changeme}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
hikari:
|
||||
max-lifetime: 1800000
|
||||
connection-test-query: SELECT 1
|
||||
validation-timeout: 3000
|
||||
idle-timeout: 600000
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
show-sql: true
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.MySQLDialect
|
||||
format_sql: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 200MB
|
||||
max-request-size: 200MB
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
servlet:
|
||||
context-path:
|
||||
tomcat:
|
||||
max-http-form-post-size: 200MB
|
||||
max-swallow-size: 200MB
|
||||
|
||||
upload:
|
||||
path: uploads
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.petstore: debug
|
||||
|
||||
wechat:
|
||||
appid: ${WECHAT_APPID:}
|
||||
appsecret: ${WECHAT_APPSECRET:}
|
||||
redirect_uri: http://localhost:8080/api/wechat/callback
|
||||
@ -21,13 +21,17 @@ spring:
|
||||
format_sql: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 120MB
|
||||
max-request-size: 120MB
|
||||
max-file-size: 200MB
|
||||
max-request-size: 200MB
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
servlet:
|
||||
context-path:
|
||||
# 与 multipart 一致,避免嵌入式 Tomcat 仍限制表单体积导致大视频 413
|
||||
tomcat:
|
||||
max-http-form-post-size: 200MB
|
||||
max-swallow-size: 200MB
|
||||
|
||||
upload:
|
||||
path: /www/petstore/uploads
|
||||
|
||||
Loading…
Reference in New Issue
Block a user