Problem connecting two services internally

Hello,

Sorry if I am missing something obvious, but I read all the documentation and all related threads I could find in the forum and I still can’t make it work.

I have an Angular frontend app that is trying to connect to a Java server and the error I’m getting is “NAME_NOT_RESOLVED”. I’m using the built-in Angular HttpClient trying to hit the java actuator health endpoint at https://my-app-name.internal:8080/actuator/health That works on my machine, but it seems I’m missing something when hosted in the fly.io private network. I also tried the internal ipv6 address, which I got from running the privatenet example and the public ipv4 address with no luck. My backend fly.toml internal port is 8080.

Any help would be greatly appreciated.

Hi @ajku1

Is your Angular app trying to connect to your Java app from the server side or the client side?

If it’s the client side then your Java app will need to be exposed to the internet otherwise it won’t be accessible.

I am sending some HTTP requests from my Angular app to the Java app, so client side I guess.

What do you mean by “expose my Java app to the internet”, I thought the public ipv4 address is always exposed, but I’m failing to get a response there too?

Do I need to set up a nginx reverse proxy on the server?

I think you need to be hitting it at https://my-app-name.fly.dev/actuator/health

Thanks a lot, that did the job.

I had the same URL in my Angular environment file, but with the port at the end, that’s why it wasn’t working…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.