Question

My API is in digital ocean droplet with an IP only, How can access my API in another Vercel app which has https and currently it blocks.

Currently a vercel app blocks all API calls claiming that the request to an insecure site can’t be made from a secure one therefore incompatible.

I need any suggestion to make this IP to be whitelisted in vercel app, I will favor suggestions on using IP and not a domain for the API.


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.

Hello,

I would recommend taking a look at this answer here by ryanpq on how to get an SSL for an IP address:

https://www.digitalocean.com/community/questions/ssl-for-ip-address

You basically have two options:

  • Create a self-signed ssl certificate. This has the benefit of being free and fairly easy to set up but will result in a security warning in most browsers since they look for a trusted authority to have issued the certificate. If you are creating this for internal use this may be the best option.

  • Purchase an SSL certificate from a provider. For this I’d recommend reaching out to a few providers to find one that will support issuing a certificate for your public IP address.

Alternatively, you could add a subdomain name to your server, like api.yourdomian.com, that way you can use Let’s Encrypt and get a free SSL certificate:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

Hope that this helps!

Regards,

Bobby