Question

Can use IP address (with port, i.e: 204.48.21.23:3000) with postman to call API , but name (from A record) not working.

So, I’m running an angular / spring boot app as containers on a droplet. For some reason, the localhost call through nginx isn’t working ( getting ERR:CONNECTION_REFUSED). However, I was able to call it using my IP : PORT address. But since I need my webserver to make calls to an android app, I decided to set it up as a different droplet (I’m not sure if this is the best way or method, I’m new to all this). So, on cloudflare I have “kronologi.ca —> ipv4” from digital ocean which serves my Web App. This works fine! I see my login page and what not.

Now, the issue is when I create a sub domain and point it to my second droplet with “api --> ipv4” and I call api.kronologi.ca:3000/rest/of/api/call , nothing works. Postman just hangs and the same applies everywhere else. However, calling IPv4:3000/rest/of/api/call works 100% fine. I’m not too sure what . I’m suppose to do or what I’m doing wrong. Is it a set up thing in my droplet?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Greetings!

Great question. You mentioned that you’re using CloudFlare and that is likely where the issue comes in at. To use alternate ports behind CloudFlare you would need to disable their proxy. In their control panel this means disabling the orange cloud and waiting for DNS caches to hit TTL values (commonly referred to as DNS propagation, though a misleading term), then it would work. With their proxy enabled they do not pass alternate ports to your server, as their CDN IPs are shared. I do believe they will offer that service to you on their higher tier paid plans though.

Jarland