diff --git a/docker-compose.yml b/docker-compose.yml index 3657414..624c462 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,9 @@ services: # 限流/缓存用 Redis;容器内 127.0.0.1 是容器自身,必须指向编排里的 redis REDIS_HOST: ${REDIS_HOST:-redis} REDIS_PORT: ${REDIS_PORT:-6379} + # CORS:公网入口 nginx 把 SSL 跑在 80 端口上(腾讯云安全组只放 80), + # 浏览器 fetch 带 Origin 时端口不匹配会被 Spring CORS 拒(必须精确字符串匹配)。 + CORS_ALLOWED_ORIGINS: "https://api.frostgiant.vip:80,https://api.frostgiant.vip,http://api.frostgiant.vip,https://39.162.50.99:8081,http://localhost:3005,http://127.0.0.1:3005" ports: - "8081:8081" volumes: @@ -108,7 +111,8 @@ services: SERVER_PORT: "8080" SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE: "2GB" SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE: "2GB" - CORS_ALLOWED_ORIGINS: "http://localhost:3005,http://127.0.0.1:3005,http://39.162.50.99:3005,http://192.168.31.250:3005" + # 浏览后台时 Origin 是实际访问地址,必须精确列全:本机、局域网、公网 IP、域名。 + CORS_ALLOWED_ORIGINS: "http://localhost:3005,http://127.0.0.1:3005,http://39.162.50.99:3005,http://192.168.31.250:3005,https://api.frostgiant.vip,https://admin.frostgiant.vip" DB_URL: ${DB_URL:-jdbc:postgresql://db:5432/${DB_NAME:-fruitshorts}} # 管理端仅内网,页面上直接播放/下载裸媒资地址(不签播放签名), # 因此这里不启用 /files/episode/** 的签名校验;公开的 app-api 仍保持开启。