Updated gateway cors

This commit is contained in:
2026-03-17 19:40:47 +03:00
parent 179d8e42a4
commit 7f24e11d82
+20 -4
View File
@@ -15,14 +15,30 @@ spring:
# 3. Gateway Routing (Modern WebFlux Namespace)
cloud:
gateway:
server:
webflux: # CRITICAL: Modern properties live under this node
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:
# --- Core Service Route ---
- id: kilimo_core_service
uri: http://localhost:9081
predicates:
- Path=/core/**
- Method=GET,POST,PUT,DELETE,OPTIONS
filters:
- RewritePath=/core/(?<segment>.*), /$\{segment}
- name: AuthFilter
@@ -32,11 +48,11 @@ spring:
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
# --- Assistant Service Route ---
- id: kilimo_assistant_service
uri: http://localhost:9082
predicates:
- Path=/assistant/**
- Method=GET,POST,PUT,DELETE,OPTIONS
filters:
- RewritePath=/assistant/(?<segment>.*), /$\{segment}
- name: AuthFilter