diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index 2d02210b..8e1d89dd 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -971,6 +971,24 @@ The Gateway can be configured to create routes based on services registered with To enable this, set `spring.cloud.gateway.discovery.locator.enabled=true` and make sure a `DiscoveryClient` implementation is on the classpath and enabled (such as Netflix Eureka, Consul or Zookeeper). +== CORS Configuration + +The gateway can be configured to control CORS behavior. The "global" CORS configuration is a map of URL patterns to https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/cors/CorsConfiguration.html[Spring Framework `CorsConfiguration`]. + +.application.yml +[source,yaml] +---- +spring: + cloud: + gateway: + globalcors: + corsConfigurations: + '[/**]': + allowedOrigins: "*" +---- + +In the example above, CORS requests will be allowed from all origins for all requested paths. + == Actuator API TODO: document the `/gateway` actuator endpoint