123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- server:
- port: 1080
- spring:
- application:
- name: gateway
- # cloud:
- # nacos:
- # server-addr: 192.168.1.66:8848,192.168.1.67:8848,192.168.1.68:8848
- gateway:
- globalcors: # 全局的跨域处理
- add-to-simple-url-handler-mapping: true # 解决options请求被拦截问题
- corsConfigurations:
- '[/**]':
- allowedOrigins: # 允许哪些网站的跨域请求
- - "http://localhost:80"
- allowedMethods: # 允许的跨域ajax的请求方式
- - "GET"
- - "POST"
- - "DELETE"
- - "PUT"
- - "OPTIONS"
- allowedHeaders: "*" # 允许在请求中携带的头信息
- allowCredentials: true # 是否允许携带cookie
- maxAge: 360000 # 这次跨域检测的有效期
- routes:
- - id: nacos-1
- uri: http://192.168.1.66:8848
- predicates:
- - Path=/**
- filters:
- - StripPrefix=1
- - id: nacos-2
- uri: http://192.168.1.67:8848
- predicates:
- - Path=/**
- filters:
- - StripPrefix=1
- - id: nacos-3
- uri: http://192.168.1.68:8848
- predicates:
- - Path=/**
- filters:
- - StripPrefix=1
|