server: port: 8080 forward-headers-strategy: framework spring: application: name: gateway-service # ---- R2DBC (reactive DB) ---- r2dbc: url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:appdb} username: ${DB_USERNAME:app} password: ${DB_PASSWORD:} pool: initial-size: 2 max-size: 10 max-idle-time: 30m cloud: consul: host: ${CONSUL_HOST:localhost} port: ${CONSUL_PORT:8500} discovery: register: true enabled: true health-check-path: /actuator/health health-check-interval: 15s prefer-ip-address: true instance-id: ${spring.application.name}:${random.value} gateway: server: webflux: trusted-proxies: 127\.0\.0\.1|10\.0\.0\..*|172\.1[6-9]\..*|172\.2[0-9]\..*|172\.3[0-1]\..*|192\.168\..* discovery: locator: enabled: true lower-case-service-id: true httpclient: connect-timeout: 5000 response-timeout: 60s default-filters: - DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST routes: # RAG Service - actuator - id: rag-service-actuator uri: lb://rag-service predicates: - Path=/api/rag/actuator/** filters: - RewritePath=/api/rag/actuator(?/?.*), /actuator${segment} - AddRequestHeader=X-Forwarded-Prefix, /api/rag # RAG Service - API endpoints - id: rag-service-api uri: lb://rag-service predicates: - Path=/api/rag/** - Method=GET,POST,PUT,DELETE filters: - RewritePath=/api/rag(?/?.*), ${segment} - AddRequestHeader=X-Forwarded-Prefix, /api/rag # Analytics Service - API endpoints - id: analytics-service-api uri: lb://analytics-service predicates: - Path=/api/analytics/** - Method=GET,POST filters: - AddRequestHeader=X-Forwarded-Prefix, /api/analytics # ---- JWT ---- jwt: secret: ${JWT_SECRET:} expiration: ${JWT_EXPIRATION:103600000} # ---- Auth path config ---- auth: public-paths: - /api/auth/login - /api/auth/register - /api/auth/refresh/token - /actuator/** - /api/*/v3/api-docs/** - /api/*/swagger-ui/** admin-paths: - /api/*/admin/** # ---- CORS ---- gateway: cors: allowed-origins: ${CORS_ORIGINS:*} # ---- Actuator ---- management: endpoints: web: exposure: include: health,info,gateway endpoint: health: show-details: always gateway: enabled: true # ---- Logging ---- logging: level: root: INFO com.posthub.gateway: DEBUG org.springframework.cloud.gateway: INFO org.springframework.r2dbc: INFO