When you are inside a container, and want to communicate with another container in the same container network, you need to use the container port, not the published host port.
curl http://product-2_frontend-2_1:8080
Note: please do not post screenshot of text - next time please paste it as test and wrap it in a “</> Preformated text” block (if not visible, it is in the submenu of the gear icon).
When i try to give curl http://product-2_frontend-2_1:8080 i was getting this error
curl http://product-2_frontend-2_1:8080
<!doctype html>HTTP Status 400 – Bad Requestbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}
HTTP Status 400 – Bad Request
Type Exception Report
Message The character [] is never valid in a domain name.
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Exception
java.lang.IllegalArgumentException: The character [] is never valid in a domain name.
org.apache.tomcat.util.http.parser.HttpParser$DomainParseState.next(HttpParser.java:1029)
org.apache.tomcat.util.http.parser.HttpParser.readHostDomainName(HttpParser.java:912)
org.apache.tomcat.util.http.parser.Host.parse(Host.java:71)
org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:298)
org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:793)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:375)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Unknown Source)
Note The full stack trace of the root cause is available in the server logs.