Read up on that. But you may need to provide different DNS entries if you’re inside or outside your LAN or add a NAT hairpin rule to your router. But this is only applicable if you’re exposing the same service to the WWW.
Some other things to try though:
Have you tried just pinging the address? Is the DNS resolution returning the address you expect?
Whats in your nginx logs? Do you see anything when you try and connect?
Within your nginx container can you ping your service directly? Is something blocking nginx from accessing the site?
If it was a certificate issue I’d expect youd just get an error from your browser saying the cert is invalid or expired.
If I had to guess though you’re running into a nat reflection issue: https://nordvpn.com/cybersecurity/glossary/nat-loopback/
Read up on that. But you may need to provide different DNS entries if you’re inside or outside your LAN or add a NAT hairpin rule to your router. But this is only applicable if you’re exposing the same service to the WWW.
Some other things to try though: