Updated gateway cors

This commit is contained in:
2026-03-17 20:22:12 +03:00
parent b3351c88ff
commit 5664e30b91
2 changed files with 84 additions and 90 deletions
+12 -15
View File
@@ -15,24 +15,19 @@ spring:
# 3. Gateway Routing (Modern WebFlux Namespace)
cloud:
gateway:
server:
webflux:
globalcors:
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:3000"
- "https://kilimo.farm"
- "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net"
allowedMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowedHeaders:
'[/**]': # URL pattern to apply the configuration to
allowedOrigins: # Allows requests from a specific origin
- "*"
allowCredentials: true
maxAge: 3600 # cache preflight response for 1 hour
allowedMethods:
- "*"
allowedHeaders:
- "*" # Allows all headers
allowCredentials: false # Allows the browser to send cookies/auth headers
maxAge: 3600 # Cache the preflight response for 1 hour
routes:
- id: kilimo_core_service
uri: http://localhost:9081
@@ -61,6 +56,8 @@ spring:
redis-rate-limiter.replenishRate: 10
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
config:
enabled: false
# 4. Actuator for Troubleshooting
management:
+13 -16
View File
@@ -15,24 +15,19 @@ spring:
# 3. Gateway Routing (Modern WebFlux Namespace)
cloud:
gateway:
server:
webflux:
globalcors:
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:3000"
- "https://kilimo.farm"
- "https://vm-qpse3mho5qps7fj2kw0hzy.vusercontent.net"
allowedMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowedHeaders:
'[/**]': # URL pattern to apply the configuration to
allowedOrigins: # Allows requests from a specific origin
- "*"
allowCredentials: true
maxAge: 3600 # cache preflight response for 1 hour
allowedMethods:
- "*"
allowedHeaders:
- "*" # Allows all headers
allowCredentials: false # Allows the browser to send cookies/auth headers
maxAge: 3600 # Cache the preflight response for 1 hour
routes:
- id: kilimo_core_service
uri: http://localhost:9081
@@ -40,7 +35,7 @@ spring:
- Path=/core/**
- Method=GET,POST,PUT,DELETE,OPTIONS
filters:
- RewritePath=/core/(?<segment>.*), /${segment}
- RewritePath=/core/(?<path>.*), /$\{path}
- name: AuthFilter
- name: RequestRateLimiter
args:
@@ -61,6 +56,8 @@ spring:
redis-rate-limiter.replenishRate: 10
redis-rate-limiter.burstCapacity: 20
key-resolver: "#{@userKeyResolver}"
config:
enabled: false
# 4. Actuator for Troubleshooting
management: