Files
qruvw_ms_configs/kilimo-gateway-production.yml
T

79 lines
2.1 KiB
YAML

server:
port: 9080
spring:
application:
name: kilimo-gateway
# 2. Redis Configuration
data:
redis:
host: localhost
port: 6379
connect-timeout: 2000ms
# 3. Gateway Routing (Modern WebFlux Namespace)
cloud:
gateway:
globalcors:
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:3000"
- "https://kilimo.farm"
- "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net"
allowedMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowedHeaders:
- "*"
allowCredentials: true
maxAge: 3600 # cache preflight response for 1 hour
routes:
- id: kilimo_core_service
uri: http://localhost:9081
predicates:
- Path=/core/**
- Method=GET,POST,PUT,DELETE,OPTIONS
filters:
- RewritePath=/core/(?<segment>.*), /$\{segment}
- name: AuthFilter
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 10
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
- id: kilimo_assistant_service
uri: http://localhost:9082
predicates:
- Path=/assistant/**
- Method=GET,POST,PUT,DELETE,OPTIONS
filters:
- RewritePath=/assistant/(?<segment>.*), /$\{segment}
- name: AuthFilter
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 10
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
# 4. Actuator for Troubleshooting
management:
endpoints:
web:
exposure:
include: gateway, health, info
endpoint:
gateway:
enabled: true
# 5. Debugging Logging (Helpful to fix the 404)
logging:
level:
org.springframework.cloud.gateway: TRACE
org.springframework.http.server.reactive: DEBUG