Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Java Spring Cloud Docker - Cannot access any service through api gateway and Cannot access any service itself

datdatyul

Active Coder
Spring Cloud Docker - Cannot access any service through api gateway and Cannot access any service itself

I have a problem about accessing any service through api gateway.
Here is the properties file of api-gateway
```
eureka.client.serviceUrl.defaultZone=http://eurekaserver:8761/eureka/
spring.application.name=api-gateway

server.port=8600

## User Service Route
spring.cloud.gateway.routes[0].id=user-service
spring.cloud.gateway.routes[0].uri=lb://user-service
spring.cloud.gateway.routes[0].predicates[0]=Path=/userservice-api/**

## Advertisement Service Route
spring.cloud.gateway.routes[1].id=advertisement-service
spring.cloud.gateway.routes[1].uri=lb://advertisement-service
spring.cloud.gateway.routes[1].predicates[0]=Path=/advertisementservice-api/**

## Management Service Route
spring.cloud.gateway.routes[2].id=management-service
spring.cloud.gateway.routes[2].uri=lb://management-service
spring.cloud.gateway.routes[2].predicates[0]=Path=/managementservice-api/**

## Report Service Route
spring.cloud.gateway.routes[3].id=report-service
spring.cloud.gateway.routes[3].uri=lb://report-service
spring.cloud.gateway.routes[3].predicates[0]=Path=/reportservice-api/**
```
For instance, I tried to access user service through api gateway, I defined the url shown below.
```
```
It didn't work (I only saw Could not send request).

I also defined some urls shown below for this purpose but all these cannot work.
```
```

I used these urls shown below but nothing changed. I still got the same error.

How can I fix it ?
Here is my project link : Link
 

New Threads

Buy us a coffee!

Back
Top Bottom