I'm building an system in a microservice architecture, I have three Spring-boot microservice and a angular app, I know how to create a eureka service and register my springboot services to it but I could not find any sources on doing it in from my angular9 app, Which left me with some questions
1.Is there way to register angular9 app on a eureka server?
2.Do i need to register my angular app in order for me to make Rest API calls through the eureka service? ie http://myfirstservice/getservice
3.If i register my springboot service to eureka server will they no longer be accessible by their default path? ie http://localhost:8081/getservice
can some clarify these to me please? I'm really stuck. Thanks in advance:)
You should use a reverse proxy server such as nginx.
Then your calls will take the form of http://yourdomain/getservice
And in your reverse proxy server, you must have a configuration that will accept requests and be proxied to your microservices, which, since you use eureka, may have addresses http://myfirstservice/getservice
For example:
http {
...
server {
listen 80;
server_name yourdomain;
set $getservice myfirstservice:8081;
}
location ~ ^/getservice/(.*)$ {
proxy_set_header Host $host:$server_port;
proxy_pass http://$getservice/getservice/$1$is_args$args;
}
}
Where myfirstservice
should be registered with eureka
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.