Server:
Port: 8080
Spring:
Application:
Name: API gateway - server
Cloud:
Gateway:
Routes:
- id: product - service
Uri: http://127.0.0.1:9001
Predicates:
- Path=/product/* *
Direct access:
No problem, http://localhost:9001/product/1
Through the gateway access:
Error 404 http://localhost:8080/product/1
Big man to look at them for you?
CodePudding user response:
Resolved: you may not have space alignmentSpring:
Application:
Name: API gateway - # server service name
Cloud: # configuration SpringCloudGateway routing
Gateway:
Routes:
- id: product - service
Uri: lb://service - product
Predicates:
- Path=/product/* *
Discovery:
A locator:
Enabled: true
The lower case - service - id: true