I used for Cross Origin in my Spring Boot Cloud Gateway this Example: Spring Cloud Cross Origin
My Configuration looks like this:
spring:
application:
name: Gateway Service
cloud:
gateway:
globalcors:
corsConfigurations:
'[/**]':
allowedOrigins: "*"
routes:
- id: UserService
uri: URL
predicates:
- Path=/service/user/**
- id: RoleService
uri: URL
predicates:
- Path=/service/role/**
- id: VerifyService
uri: URL
predicates:
- Path=/service/verify
- id: AuthService
uri: URL
predicates:
- Path=/auth/**
- id: SchoolService
uri: URL
predicates:
- Path=/service/school/**
eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
defaultZone: URL
server:
port: 80
Have anyone an Idea what I did false here, because I can't reach my Application over the Cross Origin in my React App.
My "Error" in the Browserconsole is this:
Access to XMLHttpRequest at 'URL' from origin 'localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I used already google and found the Docs in the Top, but after I added this, it still don't work
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…