8. CORS Configuration
Prev |  | Next

# 8. CORS Configuration

The gateway can be configured to control CORS behavior. The "global" CORS configuration is a map of URL patterns to Spring Framework `CorsConfiguration`.

application.yml.

    spring:
      cloud:
        gateway:
          globalcors:
            corsConfigurations:
              '[/**]':
                allowedOrigins: "docs.spring.io"
                allowedMethods:
                - GET

In the example above, CORS requests will be allowed from requests that originate from docs.spring.io for all GET requested paths.

Prev |  | Next
7. Configuration | Home | 9. Actuator API