server:
port: 9201
#service-url:
# user-service: http://localhost:8201
spring:
redis:
host: localhost
password:
port: 6379
cloud:
gateway:
discovery:
locator:
enabled: true #开启从注册中心动态创建路由的功能
lower-case-service-id: true #使用小写服务名,默认是大写
routes:
- id: path_route #路由的ID
# uri: ${service-url.user-service}/user/{id} #匹配后路由地址
# uri: ${service-url.user-service} #匹配后路由地址
uri: http://localhost:8201
predicates:
# # 指定远程地址发起的请求?????试了不好使只有全放开0.0.0.0/0好使
- RemoteAddr=192.168.1.1/24
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8001/eureka/
logging:
level:
org.springframework.cloud.gateway: debug
要不你试试用你的手机访问,手机得与电脑在同一个路由器网络中