spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

spring cloud gateway 2.5.5, return 404

Open gry77 opened this issue 5 years ago • 2 comments

Describe the bug I'm using Spring cloud 2.5.5 I can't get spring cloud gateway working in simple project. it returned me 404

Sample code here : https://github.com/gry77/poc-spring-cloud-gateway

gry77 avatar Oct 14 '21 10:10 gry77

I tested and I think a RewritePath filter is missing to access the services from the path /service. Try adding this to the spring cloud gateway configuration :

`

routes: - id: my-service uri: lb://my-service predicates: - Path=/service/** filters: - RewritePath=/service(?<segment>/?.*), /${segment}`

dsiaud avatar Oct 29 '21 14:10 dsiaud

I followed the addition of RewritePath and it works! Thanks for helping

gry77 avatar Nov 02 '21 12:11 gry77